Lines 1-39
Link Here
|
1 |
diff -urN gajim-0.10/src/common/proxy65_manager.py gajim-0.10-patched/src/common/proxy65_manager.py |
|
|
2 |
--- src/common/proxy65_manager.py Mon May 1 18:49:14 2006 |
3 |
+++ src/common/proxy65_manager.py Tue May 16 19:55:10 2006 |
4 |
@@ -15,6 +15,7 @@ |
5 |
## |
6 |
import socket |
7 |
import struct |
8 |
+import errno |
9 |
|
10 |
import common.xmpp |
11 |
from common import gajim |
12 |
@@ -246,16 +247,18 @@ |
13 |
self._recv=self._sock.recv |
14 |
except Exception, ee: |
15 |
(errnum, errstr) = ee |
16 |
- if errnum == 111: |
17 |
- self.on_failure() |
18 |
- return None |
19 |
+ if errnum in (errno.EINPROGRESS, errno.EALREADY, errno.EWOULDBLOCK): |
20 |
+ # still trying to connect |
21 |
+ return |
22 |
# win32 needs this |
23 |
- elif errnum != 10056 or self.state != 0: |
24 |
- return None |
25 |
- else: # socket is already connected |
26 |
- self._sock.setblocking(False) |
27 |
- self._send=self._sock.send |
28 |
- self._recv=self._sock.recv |
29 |
+ if errnum not in (0, 10056, errno.EISCONN): |
30 |
+ # connection failed |
31 |
+ self.on_failure() |
32 |
+ return |
33 |
+ # socket is already connected |
34 |
+ self._sock.setblocking(False) |
35 |
+ self._send=self._sock.send |
36 |
+ self._recv=self._sock.recv |
37 |
self.buff = '' |
38 |
self.state = 1 # connected |
39 |
self.idlequeue.plug_idle(self, True, False) |