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