Author: bklaas
Date: Thu Mar 17 12:30:02 2011
New Revision: 9376

URL: http://svn.slimdevices.com/jive?rev=9376&view=rev
Log:
 r49609@DaddyMac (orig r9347):  bklaas | 2011-03-08 10:48:41 -0500
 Remake branch with correct path
 r49610@DaddyMac (orig r9348):  bklaas | 2011-03-08 11:11:43 -0500
 Bug: 17009
 Description: never drill into a _getCurrentStep() object before knowing if 
_getCurrentStep() exists
 
 r49695@DaddyMac (orig r9358):  bklaas | 2011-03-13 15:04:53 -0500
 Trivial checkin to trigger build
 r49698@DaddyMac (orig r9361):  bklaas | 2011-03-14 11:50:55 -0500
 Trivial change to trigger build
 r49699@DaddyMac (orig r9362):  bklaas | 2011-03-14 11:59:55 -0500
 Please build, parabuild. PLEASE
 
 r49745@DaddyMac (orig r9374):  blblack | 2011-03-17 10:55:57 -0500
 backport of Alan's 7.6/trunk r9209 fix to 7.5.3
 r49746@DaddyMac (orig r9375):  blblack | 2011-03-17 10:57:20 -0500
 execute _handleAdvice() on any error response that includes advice

Modified:
    7.5/trunk/squeezeplay/   (props changed)
    7.5/trunk/squeezeplay/src/squeezeplay/share/applets/Demo/DemoApplet.lua
    
7.5/trunk/squeezeplay/src/squeezeplay/share/applets/SlimBrowser/SlimBrowserApplet.lua
    7.5/trunk/squeezeplay/src/squeezeplay/share/jive/net/Comet.lua

Propchange: 7.5/trunk/squeezeplay/
------------------------------------------------------------------------------
--- svk:merge (original)
+++ svk:merge Thu Mar 17 12:30:02 2011
@@ -4,6 +4,7 @@
 bbe22326-0783-4b3a-ac2b-7ab96b24c8d9:/7.3/trunk/squeezeplay:2761
 bbe22326-0783-4b3a-ac2b-7ab96b24c8d9:/7.4/trunk/squeezeplay:7681
 
bbe22326-0783-4b3a-ac2b-7ab96b24c8d9:/7.5/branches/7.5.1-controller-fix/squeezeplay:8883
+bbe22326-0783-4b3a-ac2b-7ab96b24c8d9:/7.5/branches/7.5.3bugfix/squeezeplay:9375
 bbe22326-0783-4b3a-ac2b-7ab96b24c8d9:/branches/7.0/jive:1017
 bbe22326-0783-4b3a-ac2b-7ab96b24c8d9:/branches/cometd-refactor:592
 bbe22326-0783-4b3a-ac2b-7ab96b24c8d9:/branches/mainMenuRework:1168

Modified: 
7.5/trunk/squeezeplay/src/squeezeplay/share/applets/Demo/DemoApplet.lua
URL: 
http://svn.slimdevices.com/jive/7.5/trunk/squeezeplay/src/squeezeplay/share/applets/Demo/DemoApplet.lua?rev=9376&r1=9375&r2=9376&view=diff
==============================================================================
--- 7.5/trunk/squeezeplay/src/squeezeplay/share/applets/Demo/DemoApplet.lua 
(original)
+++ 7.5/trunk/squeezeplay/src/squeezeplay/share/applets/Demo/DemoApplet.lua Thu 
Mar 17 12:30:02 2011
@@ -1,4 +1,3 @@
-
 
 -- stuff we use
 local ipairs, pairs, setmetatable, tostring, tonumber  = ipairs, pairs, 
setmetatable, tostring, tonumber

Modified: 
7.5/trunk/squeezeplay/src/squeezeplay/share/applets/SlimBrowser/SlimBrowserApplet.lua
URL: 
http://svn.slimdevices.com/jive/7.5/trunk/squeezeplay/src/squeezeplay/share/applets/SlimBrowser/SlimBrowserApplet.lua?rev=9376&r1=9375&r2=9376&view=diff
==============================================================================
--- 
7.5/trunk/squeezeplay/src/squeezeplay/share/applets/SlimBrowser/SlimBrowserApplet.lua
 (original)
+++ 
7.5/trunk/squeezeplay/src/squeezeplay/share/applets/SlimBrowser/SlimBrowserApplet.lua
 Thu Mar 17 12:30:02 2011
@@ -2098,7 +2098,7 @@
        -- these may work without an item
        
        -- Note the assumption here: event handling happens for front window 
only
-       if _getCurrentStep().actionModifier then
+       if _getCurrentStep() and _getCurrentStep().actionModifier then
                local builtInAction = actionName .. 
_getCurrentStep().actionModifier
 
                local func = _defaultActions[builtInAction]
@@ -2236,7 +2236,7 @@
 
        -- we don't care about events not on the current window
        -- assumption for event handling code: _curStep corresponds to current 
window!
-       if _getCurrentStep().menu != menu then
+       if _getCurrentStep() and _getCurrentStep().menu != menu then
                log:debug("_getCurrentStep(): ", _getCurrentStep())
 
                log:error("Ignoring, not visible, or step/windowStack out of 
sync: current step menu: ", _getCurrentStep().menu, " window menu: ", menu)

Modified: 7.5/trunk/squeezeplay/src/squeezeplay/share/jive/net/Comet.lua
URL: 
http://svn.slimdevices.com/jive/7.5/trunk/squeezeplay/src/squeezeplay/share/jive/net/Comet.lua?rev=9376&r1=9375&r2=9376&view=diff
==============================================================================
--- 7.5/trunk/squeezeplay/src/squeezeplay/share/jive/net/Comet.lua (original)
+++ 7.5/trunk/squeezeplay/src/squeezeplay/share/jive/net/Comet.lua Thu Mar 17 
12:30:02 2011
@@ -188,7 +188,7 @@
        self.chttp:setPriority(Task.PRIORITY_HIGH)
        self.rhttp:setPriority(Task.PRIORITY_HIGH)
 
-       if oldState == CONNECTING or self.state == CONNECTED then
+       if oldState == CONNECTING or oldState == CONNECTED then
                -- Reconnect
                _handshake(self)
        end
@@ -476,6 +476,13 @@
        -- Bump reqid for the next request
        self.reqid = id + 1
 
+       -- SlimServer.lua may think that we are reconnecting but actually we 
are not
+       -- because we got reconnect advice of 'none' previously.
+       -- But this request is likely user-initiated so we should try again now.
+       if self.state == UNCONNECTED or self.state == UNCONNECTING then
+               _reconnect(self)
+       end
+
        -- Send immediately unless we're batching queries
        if self.state ~= CONNECTED or self.batch ~= 0 then
                if self.state ~= CONNECTED then
@@ -581,9 +588,17 @@
 
        -- Go through all existing subscriptions and reset the pending flag
        -- so they are re-subscribed to during _connect()
-       for i, v in ipairs( self.subs ) do
-               log:debug("Will re-subscribe to ", v.subscription)
-               v.pending = true
+       for i, sub in ipairs( self.subs ) do
+               log:debug("Will re-subscribe to ", sub.subscription)
+               sub.pending = true
+               
+               -- Also remove them from the set of requests waiting to be sent
+               -- They will get readded later and we do not want duplicates
+               for j, request in ipairs(self.sent_reqs) do
+                       if sub.reqid == request.id then
+                               table.remove( self.sent_reqs, j )
+                       end
+               end
        end
 
        -- Reset clientId
@@ -649,10 +664,10 @@
 
                        log:debug(self, ": _handshake OK, clientId: ", 
self.clientId)
 
-                       -- Rewrite clientId in requests to be reset
+                       -- Rewrite clientId in requests to be resent
                        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 .. "/")
+                                       req.data.response = 
string.gsub(req.data.response, "/([%xX]+)/", "/" .. self.clientId .. "/")
                                end
                        end
 
@@ -715,6 +730,14 @@
                channel        = '/meta/reconnect',
                clientId       = self.clientId,
                connectionType = 'streaming',
+       },
+       
+       -- Need to include the /meta/subscribe here just in case the one from 
the 
+       -- /meta/connect was lost (see _connect()) due to a network problem 
+       {
+               channel      = '/meta/subscribe',
+               clientId     = self.clientId,
+               subscription = '/' .. self.clientId .. '/**',
        } }
 
        _state(self, CONNECTING)
@@ -834,7 +857,7 @@
                return false
        end
 
-       --try both sent and pending,s ince request may have been sent prior to 
knowing server was down
+       --try both sent and pending, since request may have been sent prior to 
knowing server was down
        for i, request in ipairs( self.sent_reqs ) do
                if request.id == requestId then
                        table.remove( self.sent_reqs, i )
@@ -871,17 +894,20 @@
                        end
                end
 
-               -- Log response
-               if event.error then
-                       log:warn(self, ": _response, ", event.channel, " id=", 
event.id, " failed: ", event.error)
-               else
-                       log:debug(self, ": _response, ", event.channel, " id=", 
event.id, " OK")
-               end
-
                -- Update advice if any
                if event.advice then
                        self.advice = event.advice
                        log:debug(self, ": _response, advice updated from 
server")
+               end
+
+               -- Log response
+               if event.error then
+                       log:warn(self, ": _response, ", event.channel, " id=", 
event.id, " failed: ", event.error)
+                       if event.advice then
+                               return _handleAdvice(self)
+                       end
+               else
+                       log:debug(self, ": _response, ", event.channel, " id=", 
event.id, " OK")
                end
 
                -- Handle response

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

Reply via email to