Codebase list python-h2 / f0395b5
Import upstream version 4.1.0+git20220920.1.63b6b97 Debian Janitor 1 year, 7 months ago
9 changed file(s) with 7 addition(s) and 13 deletion(s). Raw diff Collapse all Expand all
55 Author: Cory Benfield
66 Author-email: cory@lukasa.co.uk
77 License: MIT License
8 Platform: UNKNOWN
98 Classifier: Development Status :: 5 - Production/Stable
109 Classifier: Intended Audience :: Developers
1110 Classifier: License :: OSI Approved :: MIT License
9998
10099 ``h2`` was authored by Cory Benfield and is maintained
101100 by the members of `python-hyper <https://github.com/orgs/python-hyper/people>`_.
102
103
151151 when you call :meth:`data_to_send <h2.connection.H2Connection.data_to_send>`.
152152 However, once you have pulled the data out of the ``H2Connection`` internal
153153 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
155155 sending.
156156
157157 Alternatively, use tools made available by your framework. For example, the
125125 -------------------
126126
127127 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
129129 a HTTP GET, and that returns the headers sent by the client, encoded in JSON.
130130 Basically, something a lot like `httpbin.org/get`_. Nothing fancy, but this is
131131 a good way to get a handle on how you should interact with h2.
7676 """
7777 The client upgrade flow.
7878 """
79 # Step 1: Establish the TCP connecton.
79 # Step 1: Establish the TCP connection.
8080 connection = establish_tcp_connection()
8181
8282 # Step 2: Create H2 Connection object, put it in upgrade mode, and get the
7373 """
7474 The server upgrade flow.
7575 """
76 # Step 1: Establish the TCP connecton.
76 # Step 1: Establish the TCP connection.
7777 connection = establish_tcp_connection()
7878
7979 # Step 2: Read the response. We expect this to request an upgrade.
55 Author: Cory Benfield
66 Author-email: cory@lukasa.co.uk
77 License: MIT License
8 Platform: UNKNOWN
98 Classifier: Development Status :: 5 - Production/Stable
109 Classifier: Intended Audience :: Developers
1110 Classifier: License :: OSI Approved :: MIT License
9998
10099 ``h2`` was authored by Cory Benfield and is maintained
101100 by the members of `python-hyper <https://github.com/orgs/python-hyper/people>`_.
102
103
0 hpack<5,>=4.0
01 hyperframe<7,>=6.0
1 hpack<5,>=4.0
13011301 def test_basic_sending_ping_frame_logic(self, frame_factory):
13021302 """
13031303 Sending ping frames serializes a ping frame on stream 0 with
1304 approriate opaque data.
1304 appropriate opaque data.
13051305 """
13061306 c = h2.connection.H2Connection(config=self.server_config)
13071307 c.receive_data(frame_factory.preamble())
922922 @settings(suppress_health_check=[HealthCheck.function_scoped_fixture])
923923 def test_mixing_update_forms(self, frame_factory, increment):
924924 """
925 If the user mixes ackowledging data with manually incrementing windows,
925 If the user mixes acknowledging data with manually incrementing windows,
926926 we still keep track of what's going on.
927927 """
928928 # We need to refresh the encoder because hypothesis has a problem with