[Tkabber-dev] [tclxmpp commit] r50 - in trunk: . xmpp

codesite-noreply at google.com codesite-noreply at google.com
Thu Oct 30 13:52:18 MSK 2008


Author: sgolovan
Date: Thu Oct 30 03:50:48 2008
New Revision: 50

Modified:
    trunk/ChangeLog
    trunk/xmpp/tcp.tcl
    trunk/xmpp/tls.tcl
    trunk/xmpp/zlib.tcl

Log:
	* xmpp/tcp.tcl, xmpp/tls.tcl, xmpp/zlib.tcl: Protected reading from
	  the XMPP socket and disconnect it in case of read error.


Modified: trunk/ChangeLog
==============================================================================
--- trunk/ChangeLog	(original)
+++ trunk/ChangeLog	Thu Oct 30 03:50:48 2008
@@ -1,3 +1,8 @@
+2008-10-30  Sergei Golovan  <sgolovan at nes.ru>
+
+	* xmpp/tcp.tcl, xmpp/tls.tcl, xmpp/zlib.tcl: Protected reading from
+	  the XMPP socket and disconnect it in case of read error.
+
  2008-10-27  Sergei Golovan  <sgolovan at nes.ru>

  	* xmpp/tcp.tcl, xmpp/tls.tcl, xmpp/zlib.tcl: Removed calls to

Modified: trunk/xmpp/tcp.tcl
==============================================================================
--- trunk/xmpp/tcp.tcl	(original)
+++ trunk/xmpp/tcp.tcl	Thu Oct 30 03:50:48 2008
@@ -426,7 +426,12 @@
      variable $token
      upvar 0 $token state

-    set msg [read $state(sock)]
+    if {[catch {read $state(sock)} msg]} {
+        fileevent $state(sock) readable {}
+        ::close $state(sock)
+        InEmpty $state(eofCmd)
+        return
+    }

      ::xmpp::xml::parser $state(parser) parse $msg


Modified: trunk/xmpp/tls.tcl
==============================================================================
--- trunk/xmpp/tls.tcl	(original)
+++ trunk/xmpp/tls.tcl	Thu Oct 30 03:50:48 2008
@@ -543,7 +543,12 @@
      variable $token
      upvar 0 $token state

-    set msg [read $state(sock)]
+    if {[catch {read $state(sock)} msg]} {
+        fileevent $state(sock) readable {}
+        ::close $state(sock)
+        InEmpty $state(eofCmd)
+        return
+    }

      ::xmpp::xml::parser $state(parser) parse $msg


Modified: trunk/xmpp/zlib.tcl
==============================================================================
--- trunk/xmpp/zlib.tcl	(original)
+++ trunk/xmpp/zlib.tcl	Thu Oct 30 03:50:48 2008
@@ -468,7 +468,12 @@
      upvar 0 $token state

      fconfigure $state(sock) -flush input
-    set msg [read $state(sock)]
+    if {[catch {read $state(sock)} msg]} {
+        fileevent $state(sock) readable {}
+        ::close $state(sock)
+        InEmpty $state(eofCmd)
+        return
+    }

      ::xmpp::xml::parser $state(parser) parse $msg



More information about the Tkabber-dev mailing list