gnats-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Changes to gnats/contrib/tkgnats/tkpr_library.tcl


From: Michael Richardson
Subject: Changes to gnats/contrib/tkgnats/tkpr_library.tcl
Date: Mon, 31 Mar 2003 21:48:42 -0500

Index: gnats/contrib/tkgnats/tkpr_library.tcl
diff -c gnats/contrib/tkgnats/tkpr_library.tcl:1.9 
gnats/contrib/tkgnats/tkpr_library.tcl:1.10
*** gnats/contrib/tkgnats/tkpr_library.tcl:1.9  Tue Jan  7 15:46:32 2003
--- gnats/contrib/tkgnats/tkpr_library.tcl      Mon Mar 31 21:48:28 2003
***************
*** 794,802 ****
--- 794,817 ----
      return [string trim $s "\t\n "]
  }
  
+ proc gnatsd_send {s msg} {
+     global TkGnats
+ 
+     #puts stderr "gnatsd_send $s $msg"
+ 
+     if { [catch {puts $s $msg} errstr] } {
+       Msg "Failure writing to socket, assuming it was closed. Error: $errstr"
+       unset -nocomplain 
TkGnats(socket,$TkGnats(GNATS_SERVER),$TkGnats(GNATS_PORT))
+       set s  [open_socket $TkGnats(GNATS_SERVER) $TkGnats(GNATS_PORT) 
$keepopen]
+       gnatsd_chdb $s
+       puts $s $msg
+     } 
+ }
+ 
  proc gnatsd_chdb {s} {
      global TkGnats
  
+     # intentionally, this does not use gnatsd_send to avoid a loop
      puts $s "CHDB $TkGnats(GNATS_DBALIAS)"
      set rep [get_socket_reply $s]
      if {![string match 2* [lindex $rep 0]]} {
***************
*** 820,826 ****
              return -1
          }
          set cmd [subst "USER $TkGnats(UseridPassword)"]
!         puts $s $cmd
          set rep [get_socket_reply $s]    
          if {[string match 2* [lindex $rep 0]]} {
            set accesslevelstr [lindex [lindex $rep 1] end]
--- 835,841 ----
              return -1
          }
          set cmd [subst "USER $TkGnats(UseridPassword)"]
!         gnatsd_send $s $cmd
          set rep [get_socket_reply $s]    
          if {[string match 2* [lindex $rep 0]]} {
            set accesslevelstr [lindex [lindex $rep 1] end]
***************
*** 925,931 ****
          set cmd {LIST Responsible}
      } 
  
!     puts $s $cmd
      set rep [get_socket_reply $s]
      if {![string match 301* [lindex $rep 0]]} {
          Msg "GNATSD error getting GNATS $type list:\n" "[join $rep \n]"
--- 940,946 ----
          set cmd {LIST Responsible}
      } 
  
!     gnatsd_send $s $cmd
      set rep [get_socket_reply $s]
      if {![string match 301* [lindex $rep 0]]} {
          Msg "GNATSD error getting GNATS $type list:\n" "[join $rep \n]"
***************
*** 958,964 ****
          return -1
      }
  
!     puts $s "FVLD $type"
      set rep [get_socket_reply $s]
      if {![string match 301* [lindex $rep 0]]} {
          Msg "GNATSD error getting GNATS $type list:\n" "[join $rep \n]"
--- 973,979 ----
          return -1
      }
  
!     gnatsd_send $s "FVLD $type"
      set rep [get_socket_reply $s]
      if {![string match 301* [lindex $rep 0]]} {
          Msg "GNATSD error getting GNATS $type list:\n" "[join $rep \n]"
***************
*** 1168,1174 ****
          return -1
      }
  
!     puts $s "FIELDFLAGS $field"
      
      set rep [get_socket_reply $s]
  
--- 1183,1189 ----
          return -1
      }
  
!     gnatsd_send $s "FIELDFLAGS $field"
      
      set rep [get_socket_reply $s]
  
***************
*** 1238,1244 ****
          ${p}._${l}.$e config -state $state
          return
      }
!     #error "no such window for $l"
  }
  
  proc textget {l {p ""} {e text}} {
--- 1253,1259 ----
          ${p}._${l}.$e config -state $state
          return
      }
!     error "no such window for $l"
  }
  
  proc textget {l {p ""} {e text}} {
***************
*** 2113,2119 ****
          return -1
      }
  
!     puts $s "KYWD"
      set rep [get_socket_reply $s]
      #puts "rep=$rep"   
      if {[string first "Unrecognized command" [lindex $rep 0]] < 0} {
--- 2128,2134 ----
          return -1
      }
  
!     gnatsd_send $s "KYWD"
      set rep [get_socket_reply $s]
      #puts "rep=$rep"   
      if {[string first "Unrecognized command" [lindex $rep 0]] < 0} {
***************
*** 2146,2152 ****
  #        return -1
  #    }
  #
! #    puts $s "LCFG"
  #    set rep [get_socket_reply $s]
  #    #puts "rep=$rep"  
  #    if {![string match 2* [lindex $rep 0]]} {
--- 2161,2167 ----
  #        return -1
  #    }
  #
! #    gnatsd_send $s "LCFG"
  #    set rep [get_socket_reply $s]
  #    #puts "rep=$rep"  
  #    if {![string match 2* [lindex $rep 0]]} {
***************
*** 2486,2492 ****
  
      set my_addr $TkGnats(HOSTNAME)
      
!     puts $s "HELO $my_addr"
      set rep [get_socket_reply $s]
      #puts "rep=$rep"
      if {![string match 2* [lindex $rep 0]]} {
--- 2501,2507 ----
  
      set my_addr $TkGnats(HOSTNAME)
      
!     gnatsd_send $s "HELO $my_addr"
      set rep [get_socket_reply $s]
      #puts "rep=$rep"
      if {![string match 2* [lindex $rep 0]]} {
***************
*** 2496,2502 ****
      }
      
      set add [lindex [extract_email_address $TkGnats(EmailAddr)] 0]
!     puts $s "MAIL FROM: <$add>"
      set rep [get_socket_reply $s]
      #puts "rep=$rep"
      if {![string match 2* [lindex $rep 0]]} {
--- 2511,2517 ----
      }
      
      set add [lindex [extract_email_address $TkGnats(EmailAddr)] 0]
!     gnatsd_send $s "MAIL FROM: <$add>"
      set rep [get_socket_reply $s]
      #puts "rep=$rep"
      if {![string match 2* [lindex $rep 0]]} {
***************
*** 2510,2516 ****
          if {$add == {}} {
              continue
          }
!         puts $s "RCPT TO: <$add>"
          set rep [get_socket_reply $s]
          #puts "rep=$rep"
          if {![string match 2* [lindex $rep 0]]} {
--- 2525,2531 ----
          if {$add == {}} {
              continue
          }
!         gnatsd_send $s "RCPT TO: <$add>"
          set rep [get_socket_reply $s]
          #puts "rep=$rep"
          if {![string match 2* [lindex $rep 0]]} {
***************
*** 2522,2528 ****
  
      set mailtxt [escape_dots $mailtxt]
      
!     puts $s "DATA"
      set rep [get_socket_reply $s]
      #puts "rep=$rep"
      if {![string match 3* [lindex $rep 0]]} {
--- 2537,2543 ----
  
      set mailtxt [escape_dots $mailtxt]
      
!     gnatsd_send $s "DATA"
      set rep [get_socket_reply $s]
      #puts "rep=$rep"
      if {![string match 3* [lindex $rep 0]]} {
***************
*** 2531,2538 ****
          return -1
      }
      
!     puts $s $mailtxt
!     puts $s "."
      set rep [get_socket_reply $s]
      #puts "rep=$rep"
      if {![string match 2* [lindex $rep 0]]} {
--- 2546,2553 ----
          return -1
      }
      
!     gnatsd_send $s $mailtxt
!     gnatsd_send $s "."
      set rep [get_socket_reply $s]
      #puts "rep=$rep"
      if {![string match 2* [lindex $rep 0]]} {
***************
*** 3096,3102 ****
          set text "Can't open socket $TkGnats(GNATS_SERVER) 
$TkGnats(GNATS_PORT)"
          return 1
      }
!     puts $s "LOCK $prid $me"
      set rep [get_socket_reply $s]
      #puts "rep=$rep"
      if {![string match 300* [lindex $rep 0]]} {
--- 3111,3117 ----
          set text "Can't open socket $TkGnats(GNATS_SERVER) 
$TkGnats(GNATS_PORT)"
          return 1
      }
!     gnatsd_send $s "LOCK $prid $me"
      set rep [get_socket_reply $s]
      #puts "rep=$rep"
      if {![string match 300* [lindex $rep 0]]} {
***************
*** 3152,3158 ****
      if {[set s [open_socket_gnatsd]] == "-1"} {
          return "Error-3 opening socket/port $TkGnats(GNATS_SERVER) 
$TkGnats(GNATS_PORT)"
      }
!     puts $s "UNLK $prid"
      set rep [get_socket_reply $s]
      if {![string match 2* [lindex $rep 0]]} {
          set rep [lindex $rep 0]
--- 3167,3173 ----
      if {[set s [open_socket_gnatsd]] == "-1"} {
          return "Error-3 opening socket/port $TkGnats(GNATS_SERVER) 
$TkGnats(GNATS_PORT)"
      }
!     gnatsd_send $s "UNLK $prid"
      set rep [get_socket_reply $s]
      if {![string match 2* [lindex $rep 0]]} {
          set rep [lindex $rep 0]
***************
*** 3190,3210 ****
      if {[set s [open_socket_gnatsd]] == "-1"} {
          return "-1"
      }
!     puts $s "RSET"
      set rep [get_socket_reply $s]
      if {![string match 2* [lindex $rep 0]]} {
          Msg "GNATSD error sending RSET getting full text of PRID $prid:\n" 
"[join $rep \n]"
          return -1
      }
  
!     puts $s "QFMT full"
      set rep [get_socket_reply $s]
      if {![string match 2* [lindex $rep 0]]} {
          Msg "GNATSD error setting format to full text (for PRID $prid):\n" 
"[join $rep \n]"
          return -1
      }
  
!     puts $s "QUER $prid"
      set rep [get_socket_reply $s]
      if {![string match 300* [lindex $rep 0]]} {
          Msg "GNATSD error getting full text of PRID $prid:\n" "[join $rep \n]"
--- 3205,3225 ----
      if {[set s [open_socket_gnatsd]] == "-1"} {
          return "-1"
      }
!     gnatsd_send $s "RSET"
      set rep [get_socket_reply $s]
      if {![string match 2* [lindex $rep 0]]} {
          Msg "GNATSD error sending RSET getting full text of PRID $prid:\n" 
"[join $rep \n]"
          return -1
      }
  
!     gnatsd_send $s "QFMT full"
      set rep [get_socket_reply $s]
      if {![string match 2* [lindex $rep 0]]} {
          Msg "GNATSD error setting format to full text (for PRID $prid):\n" 
"[join $rep \n]"
          return -1
      }
  
!     gnatsd_send $s "QUER $prid"
      set rep [get_socket_reply $s]
      if {![string match 300* [lindex $rep 0]]} {
          Msg "GNATSD error getting full text of PRID $prid:\n" "[join $rep \n]"
***************
*** 3230,3242 ****
      if {[set s [open_socket_gnatsd]] == "-1"} {
          return "-1"
      }
!     puts $s "RSET"
      set rep [get_socket_reply $s]
      if {![string match 2* [lindex $rep 0]]} {
          Msg "GNATSD error sending RSET getting full text of PRID $prid:\n" 
"[join $rep \n]"
          return -1
      }
!     puts $s "QURY $prid"
      set rep [get_socket_reply $s]
      if {![string match 2* [lindex $rep 0]]} {
          Msg "GNATSD error getting medium text of PRID $prid:\n" "[join $rep 
\n]"
--- 3245,3257 ----
      if {[set s [open_socket_gnatsd]] == "-1"} {
          return "-1"
      }
!     gnatsd_send $s "RSET"
      set rep [get_socket_reply $s]
      if {![string match 2* [lindex $rep 0]]} {
          Msg "GNATSD error sending RSET getting full text of PRID $prid:\n" 
"[join $rep \n]"
          return -1
      }
!     gnatsd_send $s "QURY $prid"
      set rep [get_socket_reply $s]
      if {![string match 2* [lindex $rep 0]]} {
          Msg "GNATSD error getting medium text of PRID $prid:\n" "[join $rep 
\n]"
***************
*** 3372,3378 ****
      chk_fld field(>Closed-Date)   "\n"
      chk_fld field(>Start-Date)    "\n"
      chk_fld field(>End-Date)      "\n"
!     chk_fld field(>Cost)          "\n"
      chk_fld field(>Originator)    Unknown
      chk_fld field(>Responsible)   gnats
      chk_fld field(>Category)      pending
--- 3387,3393 ----
      chk_fld field(>Closed-Date)   "\n"
      chk_fld field(>Start-Date)    "\n"
      chk_fld field(>End-Date)      "\n"
!     chk_fld field(>Cost)          ""
      chk_fld field(>Originator)    Unknown
      chk_fld field(>Responsible)   gnats
      chk_fld field(>Category)      pending
***************
*** 3382,3387 ****
--- 3397,3404 ----
      chk_fld field(>Environment)   "\n"
      chk_fld field(>Audit-Trail)   "\n"
      chk_fld field(>How-To-Repeat) "\n"
+     chk_fld field(>IPsec-barf-location) "http://";
+     chk_fld field(>IPsec-look)    "\n"
  
      chk_fld field(X-GNATS-Notify) nobody
  




reply via email to

[Prev in Thread] Current Thread [Next in Thread]