From 9f26d68f47bc7729b0727ed67253503e047ea0f9 Mon Sep 17 00:00:00 2001 From: Maximilian Hils Date: Wed, 16 Sep 2015 18:44:34 +0200 Subject: adjust to netlib changes --- libpathod/protocols/http.py | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'libpathod/protocols/http.py') diff --git a/libpathod/protocols/http.py b/libpathod/protocols/http.py index 0539b68d..ac6cb374 100644 --- a/libpathod/protocols/http.py +++ b/libpathod/protocols/http.py @@ -1,14 +1,12 @@ -from netlib import tcp, http, wsgi -from netlib.http import http1 -from .. import version, app, language, utils, log +from netlib import tcp, wsgi +from netlib.exceptions import HttpReadDisconnect +from netlib.http import http1, Request +from .. import version, language -class HTTPProtocol: +class HTTPProtocol(object): def __init__(self, pathod_handler): self.pathod_handler = pathod_handler - self.wire_protocol = http1.HTTP1Protocol( - self.pathod_handler - ) def make_error_response(self, reason, body): return language.http.make_error_response(reason, body) @@ -70,4 +68,8 @@ class HTTPProtocol: return self.pathod_handler.handle_http_request, None def read_request(self, lg=None): - return self.wire_protocol.read_request(allow_empty=True) + try: + return http1.read_request(self.pathod_handler.rfile) + except HttpReadDisconnect: + # TODO: This is + return Request("", b"", b"", b"", b"", b"", b"", None, b"") -- cgit v1.2.3 From 1a6e41c2002773bb82a5d95d8d9a8ab3aa422c98 Mon Sep 17 00:00:00 2001 From: Maximilian Hils Date: Wed, 16 Sep 2015 20:12:53 +0200 Subject: minor fixes --- libpathod/protocols/http.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'libpathod/protocols/http.py') diff --git a/libpathod/protocols/http.py b/libpathod/protocols/http.py index ac6cb374..531854d6 100644 --- a/libpathod/protocols/http.py +++ b/libpathod/protocols/http.py @@ -68,8 +68,4 @@ class HTTPProtocol(object): return self.pathod_handler.handle_http_request, None def read_request(self, lg=None): - try: - return http1.read_request(self.pathod_handler.rfile) - except HttpReadDisconnect: - # TODO: This is - return Request("", b"", b"", b"", b"", b"", b"", None, b"") + return http1.read_request(self.pathod_handler.rfile) -- cgit v1.2.3