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

Commit b8f0b3d

Browse files
committed
Define MAX_FRAME_SIZE and MAX_HEADER_LIST_SIZE.
1 parent fb0db50 commit b8f0b3d

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

hyper/http20/frame.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -254,10 +254,12 @@ class SettingsFrame(Frame):
254254

255255
# We need to define the known settings, they may as well be class
256256
# attributes.
257-
HEADER_TABLE_SIZE = 0x01
258-
ENABLE_PUSH = 0x02
259-
MAX_CONCURRENT_STREAMS = 0x03
260-
INITIAL_WINDOW_SIZE = 0x04
257+
HEADER_TABLE_SIZE = 0x01
258+
ENABLE_PUSH = 0x02
259+
MAX_CONCURRENT_STREAMS = 0x03
260+
INITIAL_WINDOW_SIZE = 0x04
261+
SETTINGS_MAX_FRAME_SIZE = 0x05
262+
SETTINGS_MAX_HEADER_LIST_SIZE = 0x06
261263

262264
def __init__(self, stream_id):
263265
super(SettingsFrame, self).__init__(stream_id)

test/test_hyper.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -183,18 +183,22 @@ def test_rst_stream_frame_must_have_body_length_four(self):
183183

184184
class TestSettingsFrame(object):
185185
serialized = (
186-
b'\x00\x18\x04\x01\x00\x00\x00\x00' + # Frame header
186+
b'\x00\x24\x04\x01\x00\x00\x00\x00' + # Frame header
187187
b'\x00\x01\x00\x00\x10\x00' + # HEADER_TABLE_SIZE
188188
b'\x00\x02\x00\x00\x00\x00' + # ENABLE_PUSH
189189
b'\x00\x03\x00\x00\x00\x64' + # MAX_CONCURRENT_STREAMS
190-
b'\x00\x04\x00\x00\xFF\xFF' # INITIAL_WINDOW_SIZE
190+
b'\x00\x04\x00\x00\xFF\xFF' + # INITIAL_WINDOW_SIZE
191+
b'\x00\x05\x00\x00\x40\x00' + # SETTINGS_MAX_FRAME_SIZE
192+
b'\x00\x06\x00\x00\xFF\xFF' # SETTINGS_MAX_HEADER_LIST_SIZE
191193
)
192194

193195
settings = {
194196
SettingsFrame.HEADER_TABLE_SIZE: 4096,
195197
SettingsFrame.ENABLE_PUSH: 0,
196198
SettingsFrame.MAX_CONCURRENT_STREAMS: 100,
197199
SettingsFrame.INITIAL_WINDOW_SIZE: 65535,
200+
SettingsFrame.SETTINGS_MAX_FRAME_SIZE: 16384,
201+
SettingsFrame.SETTINGS_MAX_HEADER_LIST_SIZE: 65535,
198202
}
199203

200204
def test_settings_frame_has_only_one_flag(self):

0 commit comments

Comments
 (0)