Author: titmuss
Date: Fri Feb 22 13:28:24 2008
New Revision: 2005

URL: http://svn.slimdevices.com?rev=2005&root=Jive&view=rev
Log:
Merge r2003 from trunk.

Modified:
    branches/7.0/jive/src/pkg/jive/share/jive/net/Comet.lua

Modified: branches/7.0/jive/src/pkg/jive/share/jive/net/Comet.lua
URL: 
http://svn.slimdevices.com/branches/7.0/jive/src/pkg/jive/share/jive/net/Comet.lua?rev=2005&root=Jive&r1=2004&r2=2005&view=diff
==============================================================================
--- branches/7.0/jive/src/pkg/jive/share/jive/net/Comet.lua (original)
+++ branches/7.0/jive/src/pkg/jive/share/jive/net/Comet.lua Fri Feb 22 13:28:24 
2008
@@ -174,6 +174,8 @@
 function connect(self)
        log:debug(self, ": connect state=", self.state)
 
+       self.isactive = true
+
        if self.state == CONNECTING or self.state == CONNECTED then
                -- Already connecting/connected
                return
@@ -184,13 +186,14 @@
                _state(self, UNCONNECTED)
        end
 
-       self.isactive = true
        _handshake(self)
 end
 
 
 function disconnect(self)
        log:debug(self, ": disconnect state=", self.state)
+
+       self.isactive = false
 
        if self.state == UNCONNECTED or self.state == UNCONNECTING then
                -- Already disconnecting/unconnected
@@ -203,7 +206,6 @@
                return
        end
 
-       self.isactive = false
        _disconnect(self)
 end
 
@@ -442,7 +444,7 @@
        -- Send immediately unless we're batching queries
        if self.state ~= CONNECTED or self.batch ~= 0 then
                if self.state ~= CONNECTED then
-                       self.jnt:notify('cometDisconnected', self, 
#self.pending_reqs)
+                       self.jnt:notify('cometDisconnected', self, 
#self.pending_reqs + #self.sent_reqs)
                end
 
                return id
@@ -522,7 +524,7 @@
                self.chttp:close()
                self.rhttp:close()
 
-               self.jnt:notify('cometDisconnected', self, #self.pending_reqs)
+               self.jnt:notify('cometDisconnected', self, #self.pending_reqs + 
#self.sent_reqs)
        end
 end
 
@@ -608,6 +610,14 @@
                        self.advice    = data.advice
 
                        log:debug(self, ": _handshake OK, clientId: ", 
self.clientId)
+
+                       -- Rewrite clientId in requests to be reset
+                       for i, req in ipairs(self.sent_reqs) do
+                               if req.data.response then
+                                       req.data.response = 
string.gsub(req.data.response, "/(%x+)/", "/" .. self.clientId .. "/")
+                               end
+                       end
+
 
                        -- Continue with connect phase, note we are still not 
CONNECTED
                        _connect(self)

_______________________________________________
Jive-checkins mailing list
[email protected]
http://lists.slimdevices.com/cgi-bin/mailman/listinfo/jive-checkins

Reply via email to