Author: blblack
Date: Wed Apr 6 10:25:34 2011
New Revision: 9408
URL: http://svn.slimdevices.com/jive?rev=9408&view=rev
Log:
Comet.lua: rhttp code to set cachedIP from chttp was only present in one of two
cases of _addPendingRequests+send(), presumably due to an earlier copy+paste
and then the cachedIP fix only being applied to one copy. This is now
de-duplicated and the cachedIP fix applies to both cases.
SocketHttp.lua: t_sendResolve state was being executed when sending requests on
an already-connected socket. This results in a spurious DNS request which
updates t_tcp.address for this connection (possibly to a new IP, which is not
the one currently connected to). This in turn is the source of rhttp's
cachedIP, which can lead to chttp+rhttp split to different destinations.
t_sendDequeue now skips over both t_sendResolve and t_sendConnect when already
connected.
Modified:
7.5/trunk/squeezeplay/src/squeezeplay/share/jive/net/Comet.lua
7.5/trunk/squeezeplay/src/squeezeplay/share/jive/net/SocketHttp.lua
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=9408&r1=9407&r2=9408&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 Wed Apr 6
10:25:34 2011
@@ -344,10 +344,12 @@
-- Send any pending subscriptions and requests
-_sendPendingRequests = function(self)
+_sendPendingRequests = function(self, data)
-- add all pending unsub requests, and any others we need to send
- local data = {}
+ if not data then
+ data = {}
+ end
_addPendingRequests(self, data)
-- Only continue if we have some data to send
@@ -760,26 +762,7 @@
table.insert(data, v)
end
- -- Add any other pending requests to the outgoing data
- _addPendingRequests(self, data)
-
- -- Only continue if we have some data to send
- if data[1] then
-
- if log:isDebug() then
- log:debug("Sending pending request(s):")
- debug.dump(data, 5)
- end
-
- local req = CometRequest(
- _getEventSink(self),
- self.uri,
- data
- )
-
- self.rhttp:fetch(req)
- end
-
+ _sendPendingRequests(self, data)
_state(self, CONNECTED)
end
Modified: 7.5/trunk/squeezeplay/src/squeezeplay/share/jive/net/SocketHttp.lua
URL:
http://svn.slimdevices.com/jive/7.5/trunk/squeezeplay/src/squeezeplay/share/jive/net/SocketHttp.lua?rev=9408&r1=9407&r2=9408&view=diff
==============================================================================
--- 7.5/trunk/squeezeplay/src/squeezeplay/share/jive/net/SocketHttp.lua
(original)
+++ 7.5/trunk/squeezeplay/src/squeezeplay/share/jive/net/SocketHttp.lua Wed Apr
6 10:25:34 2011
@@ -181,7 +181,11 @@
if self.t_httpSendRequest then
log:debug(self, " send processing ", self.t_httpSendRequest)
- self:t_nextSendState(true, 't_sendResolve')
+ if self:connected() then
+ self:t_nextSendState(true, 't_sendRequest')
+ else
+ self:t_nextSendState(true, 't_sendResolve')
+ end
return
end
end
@@ -248,14 +252,12 @@
function t_sendConnect(self)
log:debug(self, ":t_sendConnect()")
- if not self:connected() then
- local err = socket.skip(1, self:t_connect())
-
- if err then
- log:error(self, ":t_sendConnect: ", err)
- self:close(err)
- return
- end
+ local err = socket.skip(1, self:t_connect())
+
+ if err then
+ log:error(self, ":t_sendConnect: ", err)
+ self:close(err)
+ return
end
self:t_nextSendState(true, 't_sendRequest')
_______________________________________________
Jive-checkins mailing list
[email protected]
http://lists.slimdevices.com/mailman/listinfo/jive-checkins