changeset d6901d0eed53 in /home/hg/repos/gajim
details:http://hg.gajim.org/gajim?cmd=changeset;node=d6901d0eed53
description: add a try/except
diffstat:
src/common/socks5.py | 39 ++++++++++++++++++++++-----------------
1 files changed, 22 insertions(+), 17 deletions(-)
diffs (52 lines):
diff -r 60f54ff36c17 -r d6901d0eed53 src/common/socks5.py
--- a/src/common/socks5.py Wed Aug 22 12:55:57 2012 +0200
+++ b/src/common/socks5.py Wed Aug 22 14:49:44 2012 +0200
@@ -1140,26 +1140,31 @@
self.disconnect()
return
self.idlequeue.remove_timeout(self.fd)
- if self.state == 2: # send reply with desired auth type
- self.send_raw(self._get_auth_response())
- elif self.state == 4: # send positive response to the 'connect'
- self.send_raw(self._get_request_buff(self.sha_msg, 0x00))
- elif self.state == 7:
- if self.file_props.paused:
- self.file_props.continue_cb = self.continue_paused_transfer
- self.idlequeue.plug_idle(self, False, False)
- return
- result = self.start_transfer() # send
- self.queue.process_result(result, self)
- if result is None or result <= 0:
+ try:
+ if self.state == 2: # send reply with desired auth type
+ self.send_raw(self._get_auth_response())
+ elif self.state == 4: # send positive response to the 'connect'
+ self.send_raw(self._get_request_buff(self.sha_msg, 0x00))
+ elif self.state == 7:
+ if self.file_props.paused:
+ self.file_props.continue_cb = self.continue_paused_transfer
+ self.idlequeue.plug_idle(self, False, False)
+ return
+ result = self.start_transfer() # send
+ self.queue.process_result(result, self)
+ if result is None or result <= 0:
+ self.disconnect()
+ return
+ self.idlequeue.set_read_timeout(self.fd, STALLED_TIMEOUT)
+ elif self.state == 8:
self.disconnect()
return
- self.idlequeue.set_read_timeout(self.fd, STALLED_TIMEOUT)
- elif self.state == 8:
- self.disconnect()
+ else:
+ self.disconnect()
+ except (OpenSSL.SSL.WantReadError, OpenSSL.SSL.WantWriteError,
+ OpenSSL.SSL.WantX509LookupError), e:
+ log.info('caught SSL exception, ignored')
return
- else:
- self.disconnect()
if self.state < 5:
self.state += 1
# unplug and plug this time for reading
_______________________________________________
Commits mailing list
[email protected]
http://lists.gajim.org/cgi-bin/listinfo/commits