diff options
author | Thomas Kriechbaumer <thomas@kriechbaumer.name> | 2016-01-27 12:52:18 +0100 |
---|---|---|
committer | Thomas Kriechbaumer <thomas@kriechbaumer.name> | 2016-02-04 09:52:28 +0100 |
commit | 6d3b3994e27b3cd97c74612bc64c7e0457aeb448 (patch) | |
tree | 2dcdd32b653f6a100e47861dc296e60efeeca90e /libmproxy/protocol/http2.py | |
parent | 64978968f2383988511dc7021ecd9892f098f723 (diff) | |
download | mitmproxy-6d3b3994e27b3cd97c74612bc64c7e0457aeb448.tar.gz mitmproxy-6d3b3994e27b3cd97c74612bc64c7e0457aeb448.tar.bz2 mitmproxy-6d3b3994e27b3cd97c74612bc64c7e0457aeb448.zip |
code formatting
Diffstat (limited to 'libmproxy/protocol/http2.py')
-rw-r--r-- | libmproxy/protocol/http2.py | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/libmproxy/protocol/http2.py b/libmproxy/protocol/http2.py index 423c5caa..5c4586de 100644 --- a/libmproxy/protocol/http2.py +++ b/libmproxy/protocol/http2.py @@ -1,6 +1,5 @@ from __future__ import (absolute_import, print_function, division) -import struct import threading import time import Queue @@ -17,9 +16,12 @@ from .base import Layer from .http import _HttpTransmissionLayer, HttpLayer from .. import utils from ..models import HTTPRequest, HTTPResponse -from ..exceptions import HttpProtocolException, ProtocolException +from ..exceptions import HttpProtocolException +from ..exceptions import ProtocolException + class SafeH2Connection(H2Connection): + def __init__(self, conn, *args, **kwargs): super(SafeH2Connection, self).__init__(*args, **kwargs) self.conn = conn @@ -71,7 +73,7 @@ class SafeH2Connection(H2Connection): if is_zombie(self, stream_id): return max_outbound_frame_size = self.max_outbound_frame_size - frame_chunk = chunk[position:position+max_outbound_frame_size] + frame_chunk = chunk[position:position + max_outbound_frame_size] if self.local_flow_control_window(stream_id) < len(frame_chunk): self.lock.release() time.sleep(0) @@ -88,6 +90,7 @@ class SafeH2Connection(H2Connection): class Http2Layer(Layer): + def __init__(self, ctx, mode): super(Http2Layer, self).__init__(ctx) self.mode = mode @@ -226,6 +229,7 @@ class Http2Layer(Layer): class Http2SingleStreamLayer(_HttpTransmissionLayer, threading.Thread): + def __init__(self, ctx, stream_id, request_headers): super(Http2SingleStreamLayer, self).__init__(ctx) self.zombie = None |