Author: titmuss
Date: Wed Jul  9 11:58:16 2008
New Revision: 2679

URL: http://svn.slimdevices.com?rev=2679&root=Jive&view=rev
Log:
Bug: 5378
Description:
Revert change r2668, this breaks SN and does not actually appear to have fixed 
the bug.


Modified:
    7.1/trunk/squeezeplay/src/squeezeplay/share/jive/net/Comet.lua

Modified: 7.1/trunk/squeezeplay/src/squeezeplay/share/jive/net/Comet.lua
URL: 
http://svn.slimdevices.com/7.1/trunk/squeezeplay/src/squeezeplay/share/jive/net/Comet.lua?rev=2679&root=Jive&r1=2678&r2=2679&view=diff
==============================================================================
--- 7.1/trunk/squeezeplay/src/squeezeplay/share/jive/net/Comet.lua (original)
+++ 7.1/trunk/squeezeplay/src/squeezeplay/share/jive/net/Comet.lua Wed Jul  9 
11:58:16 2008
@@ -341,19 +341,10 @@
 
 
 -- Send any pending subscriptions and requests
-_sendPendingRequests = function(self, addSentReqs)
+_sendPendingRequests = function(self)
 
        -- add all pending unsub requests, and any others we need to send
        local data = {}
-
-       if addSentReqs then
-               -- following re-connection we also need to include any
-               --  un-acknowledged requests to the outgoing data
-               for i, v in ipairs(self.sent_reqs) do
-                       table.insert(data, v)
-               end
-       end
-
        _addPendingRequests(self, data)
        
        -- Only continue if we have some data to send
@@ -678,12 +669,28 @@
                subscription = '/' .. self.clientId .. '/**',
        } }
 
+       -- Add any un-acknowledged requests to the outgoing data
+       for i, v in ipairs(self.sent_reqs) do
+               table.insert(data, v)
+       end
+
+       -- Add any other pending requests to the outgoing data
+       _addPendingRequests(self, data)
+
+       if log:isDebug() then
+               log:debug("Sending pending request(s):")
+               debug.dump(data, 5)
+       end
+
+       -- This will be our last request on this connection, it is now only
+       -- for listening for responses
+
        local req = CometRequest(
                        _getEventSink(self),
                        self.uri,
                        data
                )
-
+       
        self.chttp:fetch(req)
 end
 
@@ -709,14 +716,22 @@
                clientId       = self.clientId,
                connectionType = 'streaming',
        } }
+
+       -- Add any un-acknowledged requests to the outgoing data
+       for i, v in ipairs(self.sent_reqs) do
+               table.insert(data, v)
+       end
+
+       -- Add any other pending requests to the outgoing data
+       _addPendingRequests(self, data)
+
+       _state(self, CONNECTING)
        
        local req = CometRequest(
                        _getEventSink(self),
                        self.uri,
                        data
                )
-
-       _state(self, CONNECTING)
 
        self.chttp:fetch(req)
 end
@@ -792,7 +807,7 @@
                                _state(self, CONNECTED)
 
                                -- send any requests queued during connect
-                               _sendPendingRequests(self, true)
+                               _sendPendingRequests(self)
                        else
                                return _handleAdvice(self)
                        end
@@ -810,9 +825,6 @@
                elseif event.channel == '/meta/reconnect' then
                        if event.successful then
                                _state(self, CONNECTED)
-
-                               -- send any requests queued during re-connect
-                               _sendPendingRequests(self, true)
                        else
                                return _handleAdvice(self)
                        end
@@ -948,7 +960,7 @@
 
 
 _handleTimer = function(self)
-       log:debug(self, ": handleTimer state=", self.state, " 
advice.reconnect=", self.advice.reconnect)
+       log:debug(self, ": handleTimer state=", self.state, " advice=", 
self.advice)
 
        if self.state ~= UNCONNECTED then
                log:debug(self, ": ignoring timer while ", self.state)

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

Reply via email to