From d33d3663ecb166461d9cb5a78a29b44ee7a8fbb7 Mon Sep 17 00:00:00 2001 From: Maximilian Hils Date: Thu, 18 Feb 2016 13:03:40 +0100 Subject: combine projects --- pathod/protocols/http2.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 pathod/protocols/http2.py (limited to 'pathod/protocols/http2.py') diff --git a/pathod/protocols/http2.py b/pathod/protocols/http2.py new file mode 100644 index 00000000..a098a14e --- /dev/null +++ b/pathod/protocols/http2.py @@ -0,0 +1,20 @@ +from netlib.http import http2 +from .. import version, app, language, utils, log + +class HTTP2Protocol: + + def __init__(self, pathod_handler): + self.pathod_handler = pathod_handler + self.wire_protocol = http2.HTTP2Protocol( + self.pathod_handler, is_server=True, dump_frames=self.pathod_handler.http2_framedump + ) + + def make_error_response(self, reason, body): + return language.http2.make_error_response(reason, body) + + def read_request(self, lg=None): + self.wire_protocol.perform_server_connection_preface() + return self.wire_protocol.read_request(self.pathod_handler.rfile) + + def assemble(self, message): + return self.wire_protocol.assemble(message) -- cgit v1.2.3