[Twisted-Python] Patch for tcp.py

Martin Sjögren martin at strakt.com
Tue Aug 13 04:35:59 EDT 2002


Non-blocking connects seems to be handled wrong. In particular, EALREADY
is handled like EISCONN, when it should be handled like e.g.
EINPROGRESS. This is consistent for both unix and windows.

Here's a patch:


diff -u -r1.86 tcp.py
--- tcp.py      6 Aug 2002 17:12:40 -0000       1.86
+++ tcp.py      13 Aug 2002 08:17:31 -0000
@@ -230,9 +230,9 @@
         try:
             self.socket.connect(self.realAddress)
         except socket.error, se:
-            if se.args[0] in (EISCONN, EALREADY):
+            if se.args[0] == EISCONN:
                 pass
-            elif se.args[0] in (EWOULDBLOCK, EINVAL, EINPROGRESS):
+            elif se.args[0] in (EWOULDBLOCK, EINVAL, EINPROGRESS,
EALREADY):
                 self.startReading()
                 self.startWriting()
                 return



Regards,
Martin

-- 
Martin Sjögren
  martin at strakt.com              ICQ : 41245059
  Phone: +46 (0)31 7710870       Cell: +46 (0)739 169191
  GPG key: http://www.strakt.com/~martin/gpg.html




More information about the Twisted-Python mailing list