Import upstream version 4.1.0+git20220920.1.63b6b97
Debian Janitor
1 year, 7 months ago
5 | 5 |
Author: Cory Benfield
|
6 | 6 |
Author-email: cory@lukasa.co.uk
|
7 | 7 |
License: MIT License
|
8 | |
Platform: UNKNOWN
|
9 | 8 |
Classifier: Development Status :: 5 - Production/Stable
|
10 | 9 |
Classifier: Intended Audience :: Developers
|
11 | 10 |
Classifier: License :: OSI Approved :: MIT License
|
|
99 | 98 |
|
100 | 99 |
``h2`` was authored by Cory Benfield and is maintained
|
101 | 100 |
by the members of `python-hyper <https://github.com/orgs/python-hyper/people>`_.
|
102 | |
|
103 | |
|
151 | 151 |
when you call :meth:`data_to_send <h2.connection.H2Connection.data_to_send>`.
|
152 | 152 |
However, once you have pulled the data out of the ``H2Connection`` internal
|
153 | 153 |
buffer, it is *not* possible to put it back on again. For that reason, it is
|
154 | |
adviseable that you confirm how much space is available in the OS buffer before
|
|
154 |
advisable that you confirm how much space is available in the OS buffer before
|
155 | 155 |
sending.
|
156 | 156 |
|
157 | 157 |
Alternatively, use tools made available by your framework. For example, the
|
125 | 125 |
-------------------
|
126 | 126 |
|
127 | 127 |
Armed with the knowledge you just obtained, we're going to write a very simple
|
128 | |
HTTP/2 web server. The goal of this server is to write a server that can handle
|
|
128 |
HTTP/2 web server. The goal of this tutorial is to write a server that can handle
|
129 | 129 |
a HTTP GET, and that returns the headers sent by the client, encoded in JSON.
|
130 | 130 |
Basically, something a lot like `httpbin.org/get`_. Nothing fancy, but this is
|
131 | 131 |
a good way to get a handle on how you should interact with h2.
|
76 | 76 |
"""
|
77 | 77 |
The client upgrade flow.
|
78 | 78 |
"""
|
79 | |
# Step 1: Establish the TCP connecton.
|
|
79 |
# Step 1: Establish the TCP connection.
|
80 | 80 |
connection = establish_tcp_connection()
|
81 | 81 |
|
82 | 82 |
# Step 2: Create H2 Connection object, put it in upgrade mode, and get the
|
73 | 73 |
"""
|
74 | 74 |
The server upgrade flow.
|
75 | 75 |
"""
|
76 | |
# Step 1: Establish the TCP connecton.
|
|
76 |
# Step 1: Establish the TCP connection.
|
77 | 77 |
connection = establish_tcp_connection()
|
78 | 78 |
|
79 | 79 |
# Step 2: Read the response. We expect this to request an upgrade.
|
5 | 5 |
Author: Cory Benfield
|
6 | 6 |
Author-email: cory@lukasa.co.uk
|
7 | 7 |
License: MIT License
|
8 | |
Platform: UNKNOWN
|
9 | 8 |
Classifier: Development Status :: 5 - Production/Stable
|
10 | 9 |
Classifier: Intended Audience :: Developers
|
11 | 10 |
Classifier: License :: OSI Approved :: MIT License
|
|
99 | 98 |
|
100 | 99 |
``h2`` was authored by Cory Benfield and is maintained
|
101 | 100 |
by the members of `python-hyper <https://github.com/orgs/python-hyper/people>`_.
|
102 | |
|
103 | |
|
|
0 |
hpack<5,>=4.0
|
0 | 1 |
hyperframe<7,>=6.0
|
1 | |
hpack<5,>=4.0
|
1301 | 1301 |
def test_basic_sending_ping_frame_logic(self, frame_factory):
|
1302 | 1302 |
"""
|
1303 | 1303 |
Sending ping frames serializes a ping frame on stream 0 with
|
1304 | |
approriate opaque data.
|
|
1304 |
appropriate opaque data.
|
1305 | 1305 |
"""
|
1306 | 1306 |
c = h2.connection.H2Connection(config=self.server_config)
|
1307 | 1307 |
c.receive_data(frame_factory.preamble())
|
922 | 922 |
@settings(suppress_health_check=[HealthCheck.function_scoped_fixture])
|
923 | 923 |
def test_mixing_update_forms(self, frame_factory, increment):
|
924 | 924 |
"""
|
925 | |
If the user mixes ackowledging data with manually incrementing windows,
|
|
925 |
If the user mixes acknowledging data with manually incrementing windows,
|
926 | 926 |
we still keep track of what's going on.
|
927 | 927 |
"""
|
928 | 928 |
# We need to refresh the encoder because hypothesis has a problem with
|