[Tkabber-dev] r1040 - in trunk/tkabber: . jabberlib-tclxml

tkabber-svn at jabber.ru tkabber-svn at jabber.ru
Sat Mar 10 18:03:04 MSK 2007


Author: sergei
Date: 2007-03-10 18:03:04 +0300 (Sat, 10 Mar 2007)
New Revision: 1040

Modified:
   trunk/tkabber/ChangeLog
   trunk/tkabber/jabberlib-tclxml/jabberlib.tcl
Log:
	* jabberlib-tclxml/jabberlib.tcl: Added few extra checks if connection
	  exists.


Modified: trunk/tkabber/ChangeLog
===================================================================
--- trunk/tkabber/ChangeLog	2007-03-10 14:33:41 UTC (rev 1039)
+++ trunk/tkabber/ChangeLog	2007-03-10 15:03:04 UTC (rev 1040)
@@ -12,6 +12,9 @@
 	* privacy.tcl: Made error messageboxes appear only in case of errors
 	  (ignore disconnects).
 
+	* jabberlib-tclxml/jabberlib.tcl: Added few extra checks if connection
+	  exists.
+
 2007-03-09  Sergei Golovan  <sgolovan at nes.ru>
 
 	* ifacetk/iface.tcl, splash.tcl, tkabber.tcl: Withdraw main window at

Modified: trunk/tkabber/jabberlib-tclxml/jabberlib.tcl
===================================================================
--- trunk/tkabber/jabberlib-tclxml/jabberlib.tcl	2007-03-10 14:33:41 UTC (rev 1039)
+++ trunk/tkabber/jabberlib-tclxml/jabberlib.tcl	2007-03-10 15:03:04 UTC (rev 1040)
@@ -429,6 +429,9 @@
     }
 
     foreach connid $connections {
+	set idx [lsearch -exact $lib(connections) $connid]
+	if {$idx < 0} continue
+
 	cancel_keepalive $connid
 	outmsg [wrapper:streamtrailer] -connection $connid
 	set lib($connid,disconnecting) 1
@@ -437,9 +440,8 @@
 	    transport::$lib($connid,transport)::close $connid
 	}
 
+	set lib(connections) [lreplace $lib(connections) $idx $idx]
 	clear_vars $connid
-	set idx [lsearch -exact $lib(connections) $connid]
-	set lib(connections) [lreplace $lib(connections) $idx $idx]
     }
 
     if {$lib(connections) == {}} {
@@ -594,6 +596,11 @@
     variable keep_alive_id
     variable lib
 
+    if {[lsearch -exact $lib(connections) $connid] < 0} {
+	::LOG "error (jlib::inmsg) Connection $connid doesn't exist"
+	return -1
+    }
+
     # TODO
     if {$keep_alive} {
 	cancel_keepalive $connid



More information about the Tkabber-dev mailing list