diff options
Diffstat (limited to 'libpathod/pathoc.py')
| -rw-r--r-- | libpathod/pathoc.py | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/libpathod/pathoc.py b/libpathod/pathoc.py index e378e863..c2abcaeb 100644 --- a/libpathod/pathoc.py +++ b/libpathod/pathoc.py @@ -4,6 +4,16 @@ import rparse class PathocError(Exception): pass +def print_short(fp, httpversion, code, msg, headers, content): + print >> fp, "%s %s: %s bytes"%(code, msg, len(content)) + + +def print_full(fp, httpversion, code, msg, headers, content): + print >> fp, "HTTP%s/%s %s %s"%(httpversion[0], httpversion[1], code, msg) + print >> fp, headers + print >> fp, content + + class Pathoc(tcp.TCPClient): def __init__(self, ssl, host, port, clientcert): try: @@ -15,7 +25,5 @@ class Pathoc(tcp.TCPClient): r = rparse.parse_request({}, spec) r.serve(self.wfile) self.wfile.flush() - - line = self.rfile.readline() - print line + return http.read_response(self.rfile, r.method, None) |
