aboutsummaryrefslogtreecommitdiff
path: root/rpki/http_simple.py
diff options
context:
space:
mode:
authorRob Austein <sra@hactrn.net>2015-11-10 13:09:07 +0000
committerRob Austein <sra@hactrn.net>2015-11-10 13:09:07 +0000
commitac415cdd0f88f8479975627772dd0a84797b261a (patch)
tree4c943706862165f42d4164138504446c3e132ea0 /rpki/http_simple.py
parent947f220a4884a44b62afd18892b14433e440a139 (diff)
Use a lock to serialize rpkid tasks. Add temporary trace call
sequence trace code to rpki.rpkidb.models to assist in simplifying some of the gratuitously complicated method call chains. Various trivial PyLint cleanups. svn path=/branches/tk705/; revision=6161
Diffstat (limited to 'rpki/http_simple.py')
-rw-r--r--rpki/http_simple.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/rpki/http_simple.py b/rpki/http_simple.py
index 6f73def5..86b2eb5a 100644
--- a/rpki/http_simple.py
+++ b/rpki/http_simple.py
@@ -35,6 +35,8 @@ class HTTPRequestHandler(BaseHTTPServer.BaseHTTPRequestHandler):
HTTP request handler simple RPKI servers.
"""
+ rpki_handlers = ()
+
def do_POST(self):
try:
content_type = self.headers.get("Content-Type")
@@ -97,7 +99,7 @@ class BadContentType(Exception):
def client(proto_cms_msg, client_key, client_cert, server_ta, server_cert, url, q_msg,
- debug = False, replay_track = None, client_crl = None, content_type = default_content_type):
+ debug = None, replay_track = None, client_crl = None, content_type = default_content_type):
"""
Issue single a query and return the response, handling all the CMS and XML goo.
"""
@@ -110,7 +112,7 @@ def client(proto_cms_msg, client_key, client_cert, server_ta, server_cert, url,
q_cms = proto_cms_msg()
q_der = q_cms.wrap(q_msg, client_key, client_cert, client_crl)
- if debug:
+ if debug is not None:
debug.write("<!-- Query -->\n" + q_cms.pretty_print_content() + "\n")
http = httplib.HTTPConnection(u.hostname, u.port or httplib.HTTP_PORT)
@@ -130,7 +132,7 @@ def client(proto_cms_msg, client_key, client_cert, server_ta, server_cert, url,
if replay_track is not None:
replay_track.cms_timestamp = r_cms.check_replay(replay_track.cms_timestamp, url)
- if debug:
+ if debug is not None:
debug.write("<!-- Reply -->\n" + r_cms.pretty_print_content() + "\n")
return r_msg