Skip to content
This repository was archived by the owner on Jan 13, 2021. It is now read-only.

Commit 5759d54

Browse files
committed
Move stream initialization.
1 parent 111b0b9 commit 5759d54

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

hyper/http20/connection.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -373,11 +373,13 @@ def _connect_upgrade(self, sock):
373373
self._send_outstanding_data()
374374

375375
# The server will also send an initial settings frame, so get it.
376-
self._recv_cb()
377-
376+
# However, we need to make sure our stream state is set up properly
377+
# first, or any extra data we receive might cause us problems.
378378
s = self._new_stream(local_closed=True)
379379
self.recent_stream = s
380380

381+
self._recv_cb()
382+
381383
def _send_preamble(self):
382384
"""
383385
Sends the necessary HTTP/2 preamble.

0 commit comments

Comments
 (0)