[Tkabber-dev] [tclxmpp] r168 committed - * xmpp/bosh.tcl: Reduced empty packets polling frequency. Fixed...

tclxmpp at googlecode.com tclxmpp at googlecode.com
Wed Dec 4 08:24:56 MSK 2013


Revision: 168
Author:   sgolovan
Date:     Wed Dec  4 04:24:36 2013 UTC
Log:      	* xmpp/bosh.tcl: Reduced empty packets polling frequency. Fixed
	  attributes list on rescheduling.

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

Modified:
  /trunk/ChangeLog
  /trunk/xmpp/bosh.tcl

=======================================
--- /trunk/ChangeLog	Tue Dec  3 11:10:12 2013 UTC
+++ /trunk/ChangeLog	Wed Dec  4 04:24:36 2013 UTC
@@ -1,3 +1,8 @@
+2013-12-04  Sergei Golovan  <sgolovan at nes.ru>
+
+	* xmpp/bosh.tcl: Reduced empty packets polling frequency. Fixed
+	  attributes list on rescheduling.
+
  2013-12-03  Sergei Golovan  <sgolovan at nes.ru>

  	* xmpp/bosh.tcl: Initially implemented BOSH (XEP-0124 and XEP-0206)
=======================================
--- /trunk/xmpp/bosh.tcl	Tue Dec  3 11:10:12 2013 UTC
+++ /trunk/xmpp/bosh.tcl	Wed Dec  4 04:24:36 2013 UTC
@@ -152,7 +152,7 @@
      set state(sid)       ""
      set state(requests)  [expr {$state(-hold)+1}]
      set state(queries)   0
-    set state(polling)   10000
+    set state(polling)   2000
      set state(id)        ""

      if {[info exists proxyUseragent]} {
@@ -854,14 +854,15 @@
              return
          }
          default {
-            if {$state(queries) >= $state(requests) && \
-                    ![string equal [::xmpp::xml::getAttr $attrs type]  
terminate]} {
+            if {($state(queries) >= $state(requests) && \
+                    ![string equal [::xmpp::xml::getAttr $attrs type]  
terminate]) || \
+                ($state(queries) > 0 && [string equal  
$state(outdata) ""])} {
                  Debug $token 2 RESCHEDULING

                  after cancel $state(id)
                  set state(id) \
                      [after $state(polling) \
-                           [namespace code [list Request $token ""  
$attrs]]]
+                           [namespace code [list Request $token "" {}]]]
                  return
              }
          }
@@ -910,7 +911,7 @@

      after cancel $state(id)
      set state(id) \
-        [after $state(polling) [namespace code [list Request $token ""  
$attrs]]]
+        [after $state(polling) [namespace code [list Request $token ""  
{}]]]

      GetURL $token 0 [encoding convertto utf-8 $query]
      return


More information about the Tkabber-dev mailing list