From a99ef584ad184658199d6ba83c73ed173f8ac0d0 Mon Sep 17 00:00:00 2001 From: Thomas Kriechbaumer Date: Sun, 24 Jan 2016 23:16:50 +0100 Subject: reuse frame reading snippet --- libmproxy/protocol/http2.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'libmproxy/protocol/http2.py') diff --git a/libmproxy/protocol/http2.py b/libmproxy/protocol/http2.py index a6d1b73f..ff1726ae 100644 --- a/libmproxy/protocol/http2.py +++ b/libmproxy/protocol/http2.py @@ -206,12 +206,8 @@ class Http2Layer(Layer): other_conn = self.server_conn if conn == self.client_conn.connection else self.client_conn is_server = (conn == self.server_conn.connection) - field = source_conn.rfile.peek(3) - length = int(field.encode('hex'), 16) - raw_frame = source_conn.rfile.safe_read(9 + length) - with source_conn.h2.lock: - events = source_conn.h2.receive_data(raw_frame) + events = source_conn.h2.receive_data(utils.http2_read_frame(source_conn.rfile)) source_conn.send(source_conn.h2.data_to_send()) for event in events: -- cgit v1.2.3