diff options
author | Thomas Kriechbaumer <thomas@kriechbaumer.name> | 2016-01-25 21:14:58 +0100 |
---|---|---|
committer | Thomas Kriechbaumer <thomas@kriechbaumer.name> | 2016-02-04 09:52:27 +0100 |
commit | 41f4197a0dd73a2b00ea8485608ba9b05a605dd4 (patch) | |
tree | d17711f3e4ba15a8149d993487e76f5a0aad438b /libmproxy/protocol/http2.py | |
parent | 97c2530f90e8ddf0b36539408372f21f5964e9bb (diff) | |
download | mitmproxy-41f4197a0dd73a2b00ea8485608ba9b05a605dd4.tar.gz mitmproxy-41f4197a0dd73a2b00ea8485608ba9b05a605dd4.tar.bz2 mitmproxy-41f4197a0dd73a2b00ea8485608ba9b05a605dd4.zip |
test PushPromise support
Diffstat (limited to 'libmproxy/protocol/http2.py')
-rw-r--r-- | libmproxy/protocol/http2.py | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/libmproxy/protocol/http2.py b/libmproxy/protocol/http2.py index 54e7572e..71423bf7 100644 --- a/libmproxy/protocol/http2.py +++ b/libmproxy/protocol/http2.py @@ -17,7 +17,7 @@ from .base import Layer from .http import _HttpTransmissionLayer, HttpLayer from .. import utils from ..models import HTTPRequest, HTTPResponse - +from ..exceptions import HttpProtocolException, ProtocolException class SafeH2Connection(H2Connection): def __init__(self, conn, *args, **kwargs): @@ -207,7 +207,14 @@ class Http2Layer(Layer): is_server = (conn == self.server_conn.connection) with source_conn.h2.lock: - events = source_conn.h2.receive_data(utils.http2_read_frame(source_conn.rfile)) + try: + raw_frame = utils.http2_read_frame(source_conn.rfile) + except: + for stream in self.streams.values(): + stream.zombie = time.time() + return + + events = source_conn.h2.receive_data(raw_frame) source_conn.send(source_conn.h2.data_to_send()) for event in events: |