Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
set defaults for settings, and respect max_frame_size in sending
Browse files Browse the repository at this point in the history
responses to clients
kahuang committed Feb 21, 2019

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent 3271f02 commit e0dd9ae
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 2 additions & 1 deletion tornado_http2/connection.py
Original file line number Diff line number Diff line change
@@ -34,7 +34,8 @@ def __init__(self, stream, is_client, params=None, context=None):
self.context = context
self._initial_settings_written = Future()
self._serving_future = None
self._settings = {}
self._settings = {setting.code : setting.default for setting in
constants.Setting}

self.streams = {}
self.next_stream_id = 1 if is_client else 2
4 changes: 3 additions & 1 deletion tornado_http2/stream.py
Original file line number Diff line number Diff line change
@@ -323,7 +323,9 @@ def _write_chunk(self, chunk, callback=None):
if chunk:
yield self.write_lock.acquire()
while chunk:
allowance = yield self.window.consume(len(chunk))
bytes_to_write = min(len(chunk), self.conn.setting(
constants.Setting.MAX_FRAME_SIZE))
allowance = yield self.window.consume(bytes_to_write)

yield self.conn._write_frame(
Frame(constants.FrameType.DATA, 0,

0 comments on commit e0dd9ae

Please sign in to comment.