Author: titmuss
Date: Fri Feb 22 13:16:41 2008
New Revision: 2001

URL: http://svn.slimdevices.com?rev=2001&root=Jive&view=rev
Log:
Bug: 7240
Description:
Fix the socket to always honor the timeout for a read/write pump. Any changes 
to the value on the same socket were being 
ignored. This meant the http read timeout was always 0 (don't timeout).
 

Modified:
    trunk/jive/src/pkg/jive/share/jive/net/Socket.lua

Modified: trunk/jive/src/pkg/jive/share/jive/net/Socket.lua
URL: 
http://svn.slimdevices.com/trunk/jive/src/pkg/jive/share/jive/net/Socket.lua?rev=2001&root=Jive&r1=2000&r2=2001&view=diff
==============================================================================
--- trunk/jive/src/pkg/jive/share/jive/net/Socket.lua (original)
+++ trunk/jive/src/pkg/jive/share/jive/net/Socket.lua Fri Feb 22 13:16:41 2008
@@ -134,23 +134,21 @@
 
 -- t_add/remove/read/write
 function t_addRead(self, pump, timeout)
-       if not self.readPump then
-               -- task to iterate over all read pumps
-               local task = Task(tostring(self) .. "(R)",
-                                 self,
-                                 function(self, networkErr)
-                                         while self.readPump do
-                                                 if not 
self.readPump(networkErr) then
-                                                         self, networkErr = 
Task:yield(false)
-                                                 end
+       -- task to iterate over all read pumps
+       local task = Task(tostring(self) .. "(R)",
+                         self,
+                         function(self, networkErr)
+                                 while self.readPump do
+                                         if not self.readPump(networkErr) then
+                                                 self, networkErr = 
Task:yield(false)
                                          end
-                                 end,
-                                 _taskError,
-                                 self.priority)
-               self.jnt:t_addRead(self.t_sock, task, timeout)
-       end
+                                 end
+                         end,
+                         _taskError,
+                         self.priority)
 
        self.readPump = pump
+       self.jnt:t_addRead(self.t_sock, task, timeout)
 end
 
 function t_removeRead(self)
@@ -161,23 +159,21 @@
 end
 
 function t_addWrite(self, pump, timeout)
-       if not self.writePump then
-               -- task to iterate over all write pumps
-               local task = Task(tostring(self) .. "(W)",
-                                 self,
-                                 function(self, networkErr)
-                                         while self.writePump do
-                                                 if not 
self.writePump(networkErr) then
-                                                         self, networkErr = 
Task:yield(false)
-                                                 end
+       -- task to iterate over all write pumps
+       local task = Task(tostring(self) .. "(W)",
+                         self,
+                         function(self, networkErr)
+                                 while self.writePump do
+                                         if not self.writePump(networkErr) then
+                                                 self, networkErr = 
Task:yield(false)
                                          end
-                                 end,
-                                 _taskError,
-                                 self.priority)
-               self.jnt:t_addWrite(self.t_sock, task, timeout)
-       end
-               
+                                 end
+                         end,
+                         _taskError,
+                         self.priority)
+
        self.writePump = pump
+       self.jnt:t_addWrite(self.t_sock, task, timeout)
 end
 
 function t_removeWrite(self)

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

Reply via email to