aboutsummaryrefslogtreecommitdiff
path: root/rpkid/rpki/https.py
diff options
context:
space:
mode:
authorRob Austein <sra@hactrn.net>2009-12-22 21:57:32 +0000
committerRob Austein <sra@hactrn.net>2009-12-22 21:57:32 +0000
commit55d95c8b3be8c33e76a68039cd6b723f40eabd94 (patch)
tree0f593d2f2a2548f9016ff15d4650d274397b23c8 /rpkid/rpki/https.py
parentdc143998330c129e037f2adcdba1d2fb116e3548 (diff)
Handle exception that was causing unintended exit from event_loop(),
add safety net to keep servers from crashing if something like this happens again. svn path=/rpkid/rpki/async.py; revision=2902
Diffstat (limited to 'rpkid/rpki/https.py')
-rw-r--r--rpkid/rpki/https.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/rpkid/rpki/https.py b/rpkid/rpki/https.py
index b34883b7..a7d7acef 100644
--- a/rpkid/rpki/https.py
+++ b/rpkid/rpki/https.py
@@ -271,7 +271,7 @@ class http_stream(asynchat.async_chat):
rpki.log.traceback()
if etype not in (rpki.exceptions.HTTPSClientAborted,):
self.log("Closing due to error", rpki.log.warn)
- self.close()
+ self.close(force = True)
def handle_timeout(self):
self.log("Timeout, closing")
@@ -368,7 +368,12 @@ class http_stream(asynchat.async_chat):
self.retry_read = self.close
except POW.WantWriteError:
self.retry_write = self.close
-
+ except POW.SSLError, e:
+ self.log("socket shutdown threw %s, shutting down anyway" % e)
+ self.tls = None
+ asynchat.async_chat.close(self)
+ self.handle_close()
+
def log_cert(self, tag, x):
if debug_tls_certs:
rpki.log.debug("%r: HTTPS %s cert %r issuer %s [%s] subject %s [%s]" % (self, tag, x, x.getIssuer(), x.hAKI(), x.getSubject(), x.hSKI()))