diff options
author | Thomas Kriechbaumer <thomas@kriechbaumer.name> | 2016-07-05 20:14:16 +0200 |
---|---|---|
committer | Thomas Kriechbaumer <thomas@kriechbaumer.name> | 2016-07-05 20:14:28 +0200 |
commit | 64880e7ebd53ec4c079fdac6616d684c54e0fd79 (patch) | |
tree | 952eb005c6e3520a4072fbc632a9c280c80c67e7 | |
parent | 47db3469590e7987898ea753215982bde09d4568 (diff) | |
download | mitmproxy-64880e7ebd53ec4c079fdac6616d684c54e0fd79.tar.gz mitmproxy-64880e7ebd53ec4c079fdac6616d684c54e0fd79.tar.bz2 mitmproxy-64880e7ebd53ec4c079fdac6616d684c54e0fd79.zip |
handle related events from h2
-rw-r--r-- | mitmproxy/protocol/http2.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/mitmproxy/protocol/http2.py b/mitmproxy/protocol/http2.py index f398630d..28d6a890 100644 --- a/mitmproxy/protocol/http2.py +++ b/mitmproxy/protocol/http2.py @@ -145,6 +145,7 @@ class Http2Layer(base.Layer): self.streams[eid].priority_weight = event.priority_updated.weight self.streams[eid].priority_depends_on = event.priority_updated.depends_on self.streams[eid].priority_exclusive = event.priority_updated.exclusive + self.streams[eid].handled_priority_event = event.priority_updated self.streams[eid].start() elif isinstance(event, events.ResponseReceived): headers = netlib.http.Headers([[k, v] for k, v in event.headers]) @@ -205,6 +206,11 @@ class Http2Layer(base.Layer): self.streams[event.pushed_stream_id].request_data_finished.set() self.streams[event.pushed_stream_id].start() elif isinstance(event, events.PriorityUpdated): + if self.streams[eid].handled_priority_event is event: + # This event was already handled during stream creation + # HeadersFrame + Priority information as RequestReceived + return True + stream_id = event.stream_id if stream_id in self.streams.keys() and self.streams[stream_id].server_stream_id: stream_id = self.streams[stream_id].server_stream_id @@ -313,6 +319,7 @@ class Http2SingleStreamLayer(http._HttpTransmissionLayer, basethread.BaseThread) self.priority_weight = None self.priority_depends_on = None self.priority_exclusive = None + self.handled_priority_event = None @property def data_queue(self): |