[Tkabber-dev] [tclxmpp] r119 committed - * auth.tcl, component.tcl, compress.tcl, sasl.tcl, starttls.tcl: Adde...

codesite-noreply at google.com codesite-noreply at google.com
Mon Aug 17 17:10:35 MSD 2009


Revision: 119
Author: sgolovan
Date: Mon Aug 17 06:10:10 2009
Log: 	* auth.tcl, component.tcl, compress.tcl, sasl.tcl, starttls.tcl: Added
	  protection from a duble abort or timeout. Set JID after
	  authentiaction only in case of success.

	* streamerror.tcl, xml.tcl: Changed the way of generating stream XMLNS
	  prefix.

http://code.google.com/p/tclxmpp/source/detail?r=119

Modified:
  /trunk/ChangeLog
  /trunk/xmpp/auth.tcl
  /trunk/xmpp/component.tcl
  /trunk/xmpp/compress.tcl
  /trunk/xmpp/sasl.tcl
  /trunk/xmpp/starttls.tcl
  /trunk/xmpp/streamerror.tcl
  /trunk/xmpp/xml.tcl

=======================================
--- /trunk/ChangeLog	Tue Aug 11 13:01:22 2009
+++ /trunk/ChangeLog	Mon Aug 17 06:10:10 2009
@@ -1,3 +1,12 @@
+2009-08-17  Sergei Golovan  <sgolovan at nes.ru>
+
+	* auth.tcl, component.tcl, compress.tcl, sasl.tcl, starttls.tcl: Added
+	  protection from a duble abort or timeout. Set JID after
+	  authentiaction only in case of success.
+
+	* streamerror.tcl, xml.tcl: Changed the way of generating stream XMLNS
+	  prefix.
+
  2009-08-11  Sergei Golovan  <sgolovan at nes.ru>

  	* xmpp/ping.tcl: Fixed IQ registering (register ping tag instead of
=======================================
--- /trunk/xmpp/auth.tcl	Sun Apr  5 08:53:01 2009
+++ /trunk/xmpp/auth.tcl	Mon Aug 17 06:10:10 2009
@@ -451,11 +451,13 @@

      ::xmpp::Unset $xlib abortCommand

-    set jid [::xmpp::jid::jid $state(-username) \
-                              [::xmpp::Set $xlib server] \
-                              $state(-resource)]
-
-    ::xmpp::Set $xlib jid $jid
+    if {[string equal $status ok]} {
+        set jid [::xmpp::jid::jid $state(-username) \
+                                  [::xmpp::Set $xlib server] \
+                                  $state(-resource)]
+
+        ::xmpp::Set $xlib jid $jid
+    }

      # Cleanup in asynchronous mode
      if {[info exists state(-command)]} {
=======================================
--- /trunk/xmpp/component.tcl	Mon Feb 23 06:48:06 2009
+++ /trunk/xmpp/component.tcl	Mon Aug 17 06:10:10 2009
@@ -255,6 +255,9 @@
  proc ::xmpp::component::Finish {token status msg} {
      variable $token
      upvar 0 $token state
+
+    if {![info exists state(xlib)]} return
+
      set xlib $state(xlib)

      if {[info exists state(afterid)]} {
=======================================
--- /trunk/xmpp/compress.tcl	Mon Feb 23 06:48:06 2009
+++ /trunk/xmpp/compress.tcl	Mon Aug 17 06:10:10 2009
@@ -441,6 +441,8 @@
      variable $token
      upvar 0 $token state

+    if {![info exists state(xlib)]} return
+
      set xlib $state(xlib)

      if {[info exists state(afterid)]} {
=======================================
--- /trunk/xmpp/sasl.tcl	Mon Apr  6 23:47:37 2009
+++ /trunk/xmpp/sasl.tcl	Mon Aug 17 06:10:10 2009
@@ -870,6 +870,9 @@
      variable saslpack
      variable $token
      upvar 0 $token state
+
+    if {![info exists state(xlib)]} return
+
      set xlib $state(xlib)

      if {[info exists state(afterid)]} {
@@ -878,17 +881,19 @@

      ::xmpp::Unset $xlib abortCommand

-    if {[info exists state(jid)]} {
-        set jid $state(jid)
-    } elseif {[info exists state(-username)]} {
-        set jid [::xmpp::jid::jid $state(-username) \
-                                  $state(-server) \
-                                  $state(-resource)]
-    } else {
-        set jid $state(-domain)
-    }
-
-    ::xmpp::Set $xlib jid $jid
+    if {[string equal $status ok]} {
+        if {[info exists state(jid)]} {
+            set jid $state(jid)
+        } elseif {[info exists state(-username)]} {
+            set jid [::xmpp::jid::jid $state(-username) \
+                                      $state(-server) \
+                                      $state(-resource)]
+        } else {
+            set jid $state(-domain)
+        }
+
+        ::xmpp::Set $xlib jid $jid
+    }

      ::xmpp::Debug $xlib 2 "$status"

=======================================
--- /trunk/xmpp/starttls.tcl	Mon Feb 23 06:48:06 2009
+++ /trunk/xmpp/starttls.tcl	Mon Aug 17 06:10:10 2009
@@ -414,6 +414,9 @@
  proc ::xmpp::starttls::Finish {token status xmlData} {
      variable $token
      upvar 0 $token state
+
+    if {![info exists state(xlib)]} return
+
      set xlib $state(xlib)

      if {[info exists state(afterid)]} {
=======================================
--- /trunk/xmpp/streamerror.tcl	Mon Feb 23 06:48:06 2009
+++ /trunk/xmpp/streamerror.tcl	Mon Aug 17 06:10:10 2009
@@ -180,7 +180,9 @@
          }
      }

-    return [::xmpp::xml::create stream:error -subelements $subels]
+    return [::xmpp::xml::create error \
+                    -xmlns http://etherx.jabber.org/streams \
+                    -subelements $subels]
  }

  # vim:ts=8:sw=4:sts=4:et
=======================================
--- /trunk/xmpp/xml.tcl	Fri Jul 31 14:45:26 2009
+++ /trunk/xmpp/xml.tcl	Mon Aug 17 06:10:10 2009
@@ -182,7 +182,8 @@
  # Side effects:
  #       None.

-proc ::xmpp::xml::toText {xmldata {pxmlns ""} {prefixes {xml xml}}} {
+proc ::xmpp::xml::toText {xmldata {pxmlns ""}
+            {prefixes {xml xml http://etherx.jabber.org/streams stream}}} {
      set retext ""

      set tag    [lindex $xmldata 0]


More information about the Tkabber-dev mailing list