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

Commit cee3a71

Browse files
committed
Correctly initialize stream windows.
1 parent 3293221 commit cee3a71

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

hyper/http20/connection.py

+6-3
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@
2828

2929
log = logging.getLogger(__name__)
3030

31+
DEFAULT_WINDOW_SIZE = 65535
32+
33+
3134
class HTTP20Connection(object):
3235
"""
3336
An object representing a single HTTP/2 connection to a server.
@@ -137,7 +140,7 @@ def __init_state(self):
137140

138141
# Values for the settings used on an HTTP/2 connection.
139142
self._settings = {
140-
SettingsFrame.INITIAL_WINDOW_SIZE: 65535,
143+
SettingsFrame.INITIAL_WINDOW_SIZE: DEFAULT_WINDOW_SIZE,
141144
SettingsFrame.SETTINGS_MAX_FRAME_SIZE: FRAME_MAX_LEN,
142145
}
143146

@@ -513,9 +516,9 @@ def _new_stream(self, stream_id=None, local_closed=False):
513516
s = Stream(
514517
stream_id or self.next_stream_id, self._send_cb, self._recv_cb,
515518
self._close_stream, self.encoder, self.decoder,
516-
self.__wm_class(window_size), local_closed
519+
self.__wm_class(DEFAULT_WINDOW_SIZE), local_closed
517520
)
518-
s._out_flow_control_window = self._out_flow_control_window
521+
s._out_flow_control_window = window_size
519522
self.streams[s.stream_id] = s
520523
self.next_stream_id += 2
521524

0 commit comments

Comments
 (0)