aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRob Austein <sra@hactrn.net>2009-05-17 02:53:21 +0000
committerRob Austein <sra@hactrn.net>2009-05-17 02:53:21 +0000
commitf461f6f343e9ef895966d883d87dbdc1241dcf7d (patch)
tree69eca8d63e2939b87c0cb4cdb9214ceb1864e840
parent452dc3821395c2c85424a9c3be49dc7ce7977d85 (diff)
Checkpoint
svn path=/rpkid/rpki/exceptions.py; revision=2437
-rw-r--r--rpkid/rpki/exceptions.py4
-rw-r--r--rpkid/rpki/https.py14
2 files changed, 7 insertions, 11 deletions
diff --git a/rpkid/rpki/exceptions.py b/rpkid/rpki/exceptions.py
index 8a79d680..0a23e31f 100644
--- a/rpkid/rpki/exceptions.py
+++ b/rpkid/rpki/exceptions.py
@@ -235,9 +235,9 @@ class ForbiddenURI(RPKI_Exception):
Forbidden URI, does not start with correct base URI.
"""
-class HTTPSRetryFailure(RPKI_Exception):
+class HTTPSClientAborted(RPKI_Exception):
"""
- HTTPS connection failed and request has already been retried.
+ HTTPS client connection closed while in request-sent state.
"""
class BadPublicationReply(RPKI_Exception):
diff --git a/rpkid/rpki/https.py b/rpkid/rpki/https.py
index 83d8f97d..e4dcb7c1 100644
--- a/rpkid/rpki/https.py
+++ b/rpkid/rpki/https.py
@@ -50,12 +50,12 @@ rpki_content_type = "application/x-rpki"
# ================================================================
-debug = False
+debug = True
want_persistent_client = True
want_persistent_server = True
-idle_timeout_default = rpki.sundial.timedelta(seconds = 30)
+idle_timeout_default = rpki.sundial.timedelta(seconds = 90)
active_timeout_default = idle_timeout_default
default_http_version = (1, 0)
@@ -141,12 +141,6 @@ class http_request(http_message):
self.errback = errback
self.retried = False
- def retry(self):
- if self.retried:
- raise rpki.exceptions.HTTPSRetryFailure
- else:
- self.retried = True
-
def parse_first_line(self, cmd, path, version):
self.parse_version(version)
self.cmd = cmd
@@ -443,7 +437,7 @@ class http_client(http_stream):
self.queue.return_result(self.msg)
else:
self.queue.return_result(rpki.exceptions.HTTPRequestFailed(
- "HTTP request failed with status %s, reason %s, response %s" % (self.msg.code, self.msg.reason, self.msg.body)))
+ "HTTPS request failed with status %s, reason %s, response %s" % (self.msg.code, self.msg.reason, self.msg.body)))
def handle_connect(self):
self.log("Connected")
@@ -456,6 +450,8 @@ class http_client(http_stream):
self.queue.detach(self)
if self.get_terminator() is None:
self.handle_body()
+ elif self.state == "request-sent":
+ self.queue.return_result(rpki.exceptions.HTTPSClientAborted("HTTPS request aborted by close event"))
def handle_timeout(self):
if self.state != "idle":