[arch-commits] Commit in mitmproxy/trunk (PKGBUILD h2-3.0.patch)
Felix Yan
felixonmars at archlinux.org
Tue Jul 25 08:09:28 UTC 2017
Date: Tuesday, July 25, 2017 @ 08:09:28
Author: felixonmars
Revision: 246322
upgpkg: mitmproxy 2.0.2-2
fix with h2-3.0+
Added:
mitmproxy/trunk/h2-3.0.patch
Modified:
mitmproxy/trunk/PKGBUILD
--------------+
PKGBUILD | 9 ++++--
h2-3.0.patch | 81 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 87 insertions(+), 3 deletions(-)
Modified: PKGBUILD
===================================================================
--- PKGBUILD 2017-07-25 08:08:47 UTC (rev 246321)
+++ PKGBUILD 2017-07-25 08:09:28 UTC (rev 246322)
@@ -5,7 +5,7 @@
pkgname=mitmproxy
pkgver=2.0.2
-pkgrel=1
+pkgrel=2
pkgdesc="SSL-capable man-in-the-middle HTTP proxy"
arch=('any')
url="http://mitmproxy.org/"
@@ -23,10 +23,11 @@
conflicts=('pathod')
replaces=('pathod')
source=("$pkgname-$pkgver.tar.gz::https://github.com/mitmproxy/mitmproxy/archive/v$pkgver.tar.gz"
- fix-test.patch kaitai-0.7.patch)
+ fix-test.patch kaitai-0.7.patch h2-3.0.patch)
sha512sums=('8a38340b3b1dd73c99c9e9b06a59bff78a23b2a851e1032ee0b7354ac46c834a3d005a67dc5238030570719eb5f842cb2a8ce64ffc7c5a01cbfa9a9511c08e66'
'7cd8f430779df708e0a923bba43c29fcd94b1dc4e40b2cd7a5f878475911e12917e1cb130ffabc2d1f4a1dfe9883dfe6d9c2ff9cdcd5210a8a0480830d33b5a6'
- 'a0fa449ddec32478123966845863f11e9dc3589e08be21e8fa6f5b89765a01fb03de689b84c82d5d44f84ad72ba7766587273fb4413a09950f06e388d57fb45d')
+ 'a0fa449ddec32478123966845863f11e9dc3589e08be21e8fa6f5b89765a01fb03de689b84c82d5d44f84ad72ba7766587273fb4413a09950f06e388d57fb45d'
+ '859147363b1686a042923c5df8481c7078327e9e3715993ce81b68b63002f8a8bd071a17ca080268c7a0d8211b1a2bbb64a8e78250778693b1fcb6a558d3ec46')
prepare() {
cd mitmproxy-$pkgver
@@ -36,6 +37,8 @@
patch -p1 -i ../kaitai-0.7.patch
+ patch -p1 -i ../h2-3.0.patch
+
# Let's remove all the upper bounds and use system certificate store
sed -e '/certifi/d' \
-e 's/, *<[0-9=.]*//' \
Added: h2-3.0.patch
===================================================================
--- h2-3.0.patch (rev 0)
+++ h2-3.0.patch 2017-07-25 08:09:28 UTC (rev 246322)
@@ -0,0 +1,81 @@
+From ef9f0e22ea31745a91a131c193051d8df7a9eccf Mon Sep 17 00:00:00 2001
+From: Thomas Kriechbaumer <thomas at kriechbaumer.name>
+Date: Fri, 24 Mar 2017 19:24:28 +0100
+Subject: [PATCH] bump h2
+
+---
+ mitmproxy/proxy/protocol/http2.py | 6 +++---
+ setup.py | 4 ++--
+ test/mitmproxy/proxy/protocol/test_http2.py | 14 +++++++++++---
+ 3 files changed, 16 insertions(+), 8 deletions(-)
+
+diff --git a/mitmproxy/proxy/protocol/http2.py b/mitmproxy/proxy/protocol/http2.py
+index a6e8a4dd9..c1812b3da 100644
+--- a/mitmproxy/proxy/protocol/http2.py
++++ b/mitmproxy/proxy/protocol/http2.py
+@@ -188,7 +188,7 @@ def _handle_data_received(self, eid, event, source_conn):
+ self.streams[eid].kill()
+ self.connections[source_conn].safe_reset_stream(
+ event.stream_id,
+- h2.errors.REFUSED_STREAM
++ h2.errors.ErrorCodes.REFUSED_STREAM
+ )
+ self.log("HTTP body too large. Limit is {}.".format(bsl), "info")
+ else:
+@@ -207,7 +207,7 @@ def _handle_stream_ended(self, eid):
+
+ def _handle_stream_reset(self, eid, event, is_server, other_conn):
+ self.streams[eid].kill()
+- if eid in self.streams and event.error_code == h2.errors.CANCEL:
++ if eid in self.streams and event.error_code == h2.errors.ErrorCodes.CANCEL:
+ if is_server:
+ other_stream_id = self.streams[eid].client_stream_id
+ else:
+@@ -228,7 +228,7 @@ def _handle_connection_terminated(self, event, is_server):
+ event.last_stream_id,
+ event.additional_data), "info")
+
+- if event.error_code != h2.errors.NO_ERROR:
++ if event.error_code != h2.errors.ErrorCodes.NO_ERROR:
+ # Something terrible has happened - kill everything!
+ self.connections[self.client_conn].close_connection(
+ error_code=event.error_code,
+diff --git a/test/mitmproxy/proxy/protocol/test_http2.py b/test/mitmproxy/proxy/protocol/test_http2.py
+index 1f695cc5f..23027c242 100644
+--- a/test/mitmproxy/proxy/protocol/test_http2.py
++++ b/test/mitmproxy/proxy/protocol/test_http2.py
+@@ -36,7 +36,11 @@ class _Http2ServerBase(net_tservers.ServerTestBase):
+ class handler(mitmproxy.net.tcp.BaseHandler):
+
+ def handle(self):
+- h2_conn = h2.connection.H2Connection(client_side=False, header_encoding=False)
++ config = h2.config.H2Configuration(
++ client_side=False,
++ validate_outbound_headers=False,
++ validate_inbound_headers=False)
++ h2_conn = h2.connection.H2Connection(config)
+
+ preamble = self.rfile.read(24)
+ h2_conn.initiate_connection()
+@@ -138,7 +142,11 @@ def _setup_connection(self):
+
+ client.convert_to_ssl(alpn_protos=[b'h2'])
+
+- h2_conn = h2.connection.H2Connection(client_side=True, header_encoding=False)
++ config = h2.config.H2Configuration(
++ client_side=True,
++ validate_outbound_headers=False,
++ validate_inbound_headers=False)
++ h2_conn = h2.connection.H2Connection(config)
+ h2_conn.initiate_connection()
+ client.wfile.write(h2_conn.data_to_send())
+ client.wfile.flush()
+@@ -756,7 +764,7 @@ class TestMaxConcurrentStreams(_Http2Test):
+ @classmethod
+ def setup_class(cls):
+ _Http2TestBase.setup_class()
+- _Http2ServerBase.setup_class(h2_server_settings={h2.settings.MAX_CONCURRENT_STREAMS: 2})
++ _Http2ServerBase.setup_class(h2_server_settings={h2.settings.SettingCodes.MAX_CONCURRENT_STREAMS: 2})
+
+ @classmethod
+ def handle_server_event(cls, event, h2_conn, rfile, wfile):
More information about the arch-commits
mailing list