Author: titmuss
Date: Wed Jan 30 10:22:28 2008
New Revision: 1704

URL: http://svn.slimdevices.com?rev=1704&root=Jive&view=rev
Log:
 [EMAIL PROTECTED] (orig r1701):  titmuss | 2008-01-30 15:47:18 +0000
 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:
    trunk/   (props changed)
    trunk/jive/src/pkg/jive/share/jive/net/SocketHttp.lua

Propchange: trunk/
------------------------------------------------------------------------------
--- svk:merge (original)
+++ svk:merge Wed Jan 30 10:22:28 2008
@@ -1,3 +1,3 @@
-bbe22326-0783-4b3a-ac2b-7ab96b24c8d9:/branches/7.0:1695
+bbe22326-0783-4b3a-ac2b-7ab96b24c8d9:/branches/7.0:1701
 bbe22326-0783-4b3a-ac2b-7ab96b24c8d9:/branches/SN:1083
 bbe22326-0783-4b3a-ac2b-7ab96b24c8d9:/branches/scrolling:1378

Modified: trunk/jive/src/pkg/jive/share/jive/net/SocketHttp.lua
URL: 
http://svn.slimdevices.com/trunk/jive/src/pkg/jive/share/jive/net/SocketHttp.lua?rev=1704&root=Jive&r1=1703&r2=1704&view=diff
==============================================================================
--- trunk/jive/src/pkg/jive/share/jive/net/SocketHttp.lua (original)
+++ trunk/jive/src/pkg/jive/share/jive/net/SocketHttp.lua Wed Jan 30 10:22:28 
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

Reply via email to