Author: richard
Date: Fri Apr  3 13:38:37 2009
New Revision: 5144

URL: http://svn.slimdevices.com/jive?rev=5144&view=rev
Log:
 r5...@harrypotter (orig r5143):  richard | 2009-04-03 21:37:58 +0100
  r5...@harrypotter (orig r5141):  richard | 2009-04-03 21:36:06 +0100
  Bug: N/A
  Description:
  Fix jive connection issue. If a http socket is closed while an async dns 
request is happening, the socket would get into a bad state and 
  stop working. This could cause connection problems with SN.
  
  
 

Modified:
    7.4/branches/pango/   (props changed)
    7.4/branches/pango/squeezeplay/src/squeezeplay/share/jive/net/SocketHttp.lua

Propchange: 7.4/branches/pango/
------------------------------------------------------------------------------
--- svk:merge (original)
+++ svk:merge Fri Apr  3 13:38:37 2009
@@ -3,8 +3,8 @@
 bbe22326-0783-4b3a-ac2b-7ab96b24c8d9:/7.1/trunk:2920
 bbe22326-0783-4b3a-ac2b-7ab96b24c8d9:/7.2/trunk:2921
 bbe22326-0783-4b3a-ac2b-7ab96b24c8d9:/7.3/private-branches/jive-refresh:3653
-bbe22326-0783-4b3a-ac2b-7ab96b24c8d9:/7.3/trunk:5130
-bbe22326-0783-4b3a-ac2b-7ab96b24c8d9:/7.4/trunk:5135
+bbe22326-0783-4b3a-ac2b-7ab96b24c8d9:/7.3/trunk:5141
+bbe22326-0783-4b3a-ac2b-7ab96b24c8d9:/7.4/trunk:5143
 bbe22326-0783-4b3a-ac2b-7ab96b24c8d9:/branches/7.0:2013
 bbe22326-0783-4b3a-ac2b-7ab96b24c8d9:/branches/SN:1083
 bbe22326-0783-4b3a-ac2b-7ab96b24c8d9:/branches/scrolling:1378

Modified: 
7.4/branches/pango/squeezeplay/src/squeezeplay/share/jive/net/SocketHttp.lua
URL: 
http://svn.slimdevices.com/jive/7.4/branches/pango/squeezeplay/src/squeezeplay/share/jive/net/SocketHttp.lua?rev=5144&r1=5143&r2=5144&view=diff
==============================================================================
--- 
7.4/branches/pango/squeezeplay/src/squeezeplay/share/jive/net/SocketHttp.lua 
(original)
+++ 
7.4/branches/pango/squeezeplay/src/squeezeplay/share/jive/net/SocketHttp.lua 
Fri Apr  3 13:38:37 2009
@@ -210,21 +210,27 @@
                return
        end
 
-       local t = Task(tostring(self) .. "(D)",
-                      self,
-                      function()
-                              log:debug(self, " DNS loopup for ", self.host)
-                              local ip, err = DNS:toip(self.host)
-
-                              log:debug(self, " IP=", ip)
-                              if not ip then
-                                      self:close(self.host .. " " .. err)
-                                      return
-                              end
-
-                              self.t_tcp.address = ip
-                              self:t_nextSendState(true, 't_sendConnect')
-                      end)
+       local t = Task(tostring(self) .. "(D)", self, function()
+               log:debug(self, " DNS loopup for ", self.host)
+               local ip, err = DNS:toip(self.host)
+
+               -- make sure the socket has not closed while
+               -- resolving DNS
+               if self.t_httpSendState ~= 't_sendResolve' then
+                       log:debug(self, " socket closed during DNS request")
+                       return
+               end
+
+               log:debug(self, " IP=", ip)
+               if not ip then
+               self:close(self.host .. " " .. err)
+                       return
+               end
+
+               self.t_tcp.address = ip
+               self:t_nextSendState(true, 't_sendConnect')
+       end)
+
        t:addTask()
 end
 

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

Reply via email to