New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft 14 framer stream #21
Conversation
- 24-bit frame size - Default max frame size is 16384, not 16383 - Setting identifier is now 16-bit - Remove PAD_HIGH, padding in CONTINUATION - Allow extension frames, extension settings
- Priority parameters are weight, stream_dependency, exclusive - Stream statemachine adjusted for h2-14 - PRIORITY after stream close allowed - Header block continuation handling - Splitting large frame into smaller (DATA, HEADERS, PUSH_PROMISE) - Pseudo headers at the beginning
def encode(frame) | ||
frames = [frame] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be a conditional? I.e. if you pass an array then it shouldn't be wrapped in another array?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This method expects only one frame as input.
When encoding HEAD or PUSH_PROMISE, there might be CONTINUATIONs when the compressed header block is too large.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I'm still missing something.. If we expect to process only one frame, then why add the logic to iterate or an array? On the other hand, if you pass in an array, 338 will end up wrapping an array inside of another array.. that you'd have to flatten?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I found what's wrong with me. The lines should read
if frame is HEADERS or PUSH_PROMISE
frames = encode_headers(frame) # this creates more than one frame
else
frames = [frame]
end
frames.map { loop over frames }
L.338 should not pretend to be a common case. It should be in an else clause.
Does this explain well?
Overall, lgtm! Just a couple of small nits and questions... P.S. Kudos for the great work! |
Travis build failed with an syntax error. I'll work on this. 0bd0fae fixes this |
great stuff, thanks! |
Updates for framer, stream, and connection.
Unfortunately, tests fail between these two commits.
I recommend squash-before-merge (so that git bisect works).
If you find commits are too large, please tell me so. I'll work harder to make commits smaller.