[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[minion-cvs] maint] Cach unexpected (Want*) errors from clients; it ...
Update of /home/minion/cvsroot/src/minion/lib/mixminion
In directory moria.mit.edu:/tmp/cvs-serv19227/lib/mixminion
Modified Files:
Tag: mixminion-v0-0-5-patches
MMTPClient.py
Log Message:
[maint] Cach unexpected (Want*) errors from clients; it seems that they may be possible on timeouts
Index: MMTPClient.py
===================================================================
RCS file: /home/minion/cvsroot/src/minion/lib/mixminion/MMTPClient.py,v
retrieving revision 1.37
retrieving revision 1.37.2.1
diff -u -d -r1.37 -r1.37.2.1
--- MMTPClient.py 4 Sep 2003 16:08:13 -0000 1.37
+++ MMTPClient.py 19 Oct 2003 03:36:49 -0000 1.37.2.1
@@ -67,7 +67,8 @@
errors."""
try:
self._connect(connectTimeout)
- except (socket.error, _ml.TLSError, _ml.TLSClosed), e:
+ except (socket.error, _ml.TLSError, _ml.TLSClosed,
+ _ml.TLSWantRead, _ml.TLSWantWrite), e:
self._raise(e, "connecting")
def _raise(self, err, action):
@@ -80,6 +81,10 @@
tp = "TLS"
elif isinstance(err, _ml.TLSClosed):
tp = "TLSClosed"
+ elif isinstance(err, _ml.TLSWantRead):
+ tp = "Unexpected TLSWantRead"
+ elif isinstance(err, _ml.TLSWantWrite):
+ tp = "Unexpected TLSWantWrite"
else:
tp = str(type(err))
e = MixProtocolError("%s error while %s to %s:%s: %s" %(
@@ -201,7 +206,8 @@
LOG.warn("Received bad ACK from server")
raise MixProtocolError("Bad ACK received")
LOG.debug("ACK received; packet successfully delivered")
- except (socket.error, _ml.TLSError, _ml.TLSClosed), e:
+ except (socket.error, _ml.TLSError, _ml.TLSClosed, _ml.TLSWantRead,
+ _ml.TLSWantWrite, _ml.TLSClosed), e:
self._raise(e, "sending packet")
def shutdown(self):
@@ -213,7 +219,8 @@
self.tls.shutdown()
if self.sock is not None:
self.sock.close()
- except (socket.error, _ml.TLSError, _ml.TLSClosed), e:
+ except (socket.error, _ml.TLSError, _ml.TLSClosed, _ml.TLSWantRead,
+ _ml.TLSWantWrite, _ml.TLSClosed), e:
self._raise(e, "closing connection")
LOG.debug("Connection closed")