Author: titmuss
Date: Wed Jan 30 07:47:18 2008
New Revision: 1701
URL: http://svn.slimdevices.com?rev=1701&root=Jive&view=rev
Log:
Bug: 6763
Description:
SqueezeCenter was closing the artwork connections every 30 requests. In Jive
'Connection: close' was not being handled
correctly and this caused the next request with the same SocketHttp object to
fail.
Modified:
branches/7.0/jive/src/pkg/jive/share/jive/net/SocketHttp.lua
Modified: branches/7.0/jive/src/pkg/jive/share/jive/net/SocketHttp.lua
URL:
http://svn.slimdevices.com/branches/7.0/jive/src/pkg/jive/share/jive/net/SocketHttp.lua?rev=1701&root=Jive&r1=1700&r2=1701&view=diff
==============================================================================
--- branches/7.0/jive/src/pkg/jive/share/jive/net/SocketHttp.lua (original)
+++ branches/7.0/jive/src/pkg/jive/share/jive/net/SocketHttp.lua Wed Jan 30
07:47:18 2008
@@ -36,7 +36,6 @@
local math = require("math")
local table = require("table")
local string = require("string")
-local debug = require("debug")
local coroutine = require("coroutine")
local oo = require("loop.simple")
@@ -47,6 +46,7 @@
local SocketTcp = require("jive.net.SocketTcp")
local RequestHttp = require("jive.net.RequestHttp")
+local debug = require("jive.utils.debug")
local locale = require("jive.utils.locale")
local log = require("jive.utils.log").logger("net.http")
@@ -681,16 +681,18 @@
local mode
local len
-
- if self.t_httpReceiving:t_getResponseHeader('Transfer-Encoding') ==
'chunked' then
+
+ local httpReceiving = self.t_httpReceiving
+
+ if httpReceiving:t_getResponseHeader('Transfer-Encoding') == 'chunked'
then
mode = 'jive-http-chunked'
else
- if self.t_httpReceiving:t_getResponseHeader("Content-Length")
then
+ if httpReceiving:t_getResponseHeader("Content-Length") then
-- if we have a length, use it!
- len =
tonumber(self.t_httpReceiving:t_getResponseHeader("Content-Length"))
+ len =
tonumber(httpReceiving:t_getResponseHeader("Content-Length"))
mode = 'jive-by-length'
else
@@ -701,8 +703,8 @@
local source = socket.source(mode, self.t_sock, len or self)
- local sinkMode = self.t_httpReceiving:t_getResponseSinkMode()
- local sink = _getSink(sinkMode, self.t_httpReceiving)
+ local sinkMode = httpReceiving:t_getResponseSinkMode()
+ local sink = _getSink(sinkMode, httpReceiving)
local pump = function (NetworkThreadErr)
-- log:debug(self, ":t_rcvResponse.pump(", mode, ", ",
tostring(nt_err) , ")")
@@ -734,6 +736,11 @@
return
end
+ if httpReceiving:t_getResponseHeader('Connection') ==
'close' then
+ -- just close the socket, don't reset our state
+ SocketTcp.close(self)
+ end
+
-- move on to our future
self:t_rcvNext(true, 't_rcvSend')
end
_______________________________________________
Jive-checkins mailing list
[email protected]
http://lists.slimdevices.com/cgi-bin/mailman/listinfo/jive-checkins