diff options
| author | Thomas Kriechbaumer <thomas@kriechbaumer.name> | 2016-08-14 13:06:33 +0200 | 
|---|---|---|
| committer | Thomas Kriechbaumer <thomas@kriechbaumer.name> | 2016-08-14 13:06:33 +0200 | 
| commit | 8f4baf42ea83e2a591c989ea79c4f8fd89db9552 (patch) | |
| tree | 691d79df8c715693481b076e81fd1ba352870f78 | |
| parent | 0cc695407dab288ab3854179a2b87302d40204a2 (diff) | |
| download | mitmproxy-8f4baf42ea83e2a591c989ea79c4f8fd89db9552.tar.gz mitmproxy-8f4baf42ea83e2a591c989ea79c4f8fd89db9552.tar.bz2 mitmproxy-8f4baf42ea83e2a591c989ea79c4f8fd89db9552.zip | |
http2: cleanup
| -rw-r--r-- | mitmproxy/protocol/http2.py | 3 | ||||
| -rw-r--r-- | test/mitmproxy/test_protocol_http2.py | 6 | 
2 files changed, 6 insertions, 3 deletions
| diff --git a/mitmproxy/protocol/http2.py b/mitmproxy/protocol/http2.py index 1b2f5cf5..0e42d619 100644 --- a/mitmproxy/protocol/http2.py +++ b/mitmproxy/protocol/http2.py @@ -573,6 +573,9 @@ class Http2SingleStreamLayer(http._HttpTransmissionLayer, basethread.BaseThread)              chunks          ) +    def __call__(self): +        raise EnvironmentError('Http2SingleStreamLayer must be run as thread') +      def run(self):          layer = http.HttpLayer(self, self.mode) diff --git a/test/mitmproxy/test_protocol_http2.py b/test/mitmproxy/test_protocol_http2.py index f0fa9a40..873c89c3 100644 --- a/test/mitmproxy/test_protocol_http2.py +++ b/test/mitmproxy/test_protocol_http2.py @@ -849,15 +849,15 @@ class TestMaxConcurrentStreams(_Http2Test):      def test_max_concurrent_streams(self):          client, h2_conn = self._setup_connection()          new_streams = [1, 3, 5, 7, 9, 11] -        for id in new_streams: +        for stream_id in new_streams:              # this will exceed MAX_CONCURRENT_STREAMS on the server connection              # and cause mitmproxy to throttle stream creation to the server -            self._send_request(client.wfile, h2_conn, stream_id=id, headers=[ +            self._send_request(client.wfile, h2_conn, stream_id=stream_id, headers=[                  (':authority', "127.0.0.1:{}".format(self.server.server.address.port)),                  (':method', 'GET'),                  (':scheme', 'https'),                  (':path', '/'), -                ('X-Stream-ID', str(id)), +                ('X-Stream-ID', str(stream_id)),              ])          ended_streams = 0 | 
