molnarg / node-http2-protocol Goto Github PK
View Code? Open in Web Editor NEWWARNING: This code was merged into node-http2
Home Page: https://github.com/molnarg/node-http2
License: MIT License
WARNING: This code was merged into node-http2
Home Page: https://github.com/molnarg/node-http2
License: MIT License
If a frame size exceeds any defined limit, or is too small to contain mandatory frame data, the endpoint MUST send a FRAME_SIZE_ERROR error (draft-09, section 4.2)
Implementations MUST ignore frames of unsupported or unrecognized types (draft-09, section 4.1). Now endpoint fails when receives incoming frame with unknown frame type in function readCommonHeader.
For all frame types, lib/stream.js uses this._pushUpstream to submit the frame for sending, which in turn calls Flow.prototype.push. In Flow.prototype.push, we could conceivably get into a state where there are DATA frames queued (so this._queue.length !== 0), so moreNeeded will not get set to non-null, and the check on line 278 will evaluate to true, thus enqueuing the frame, regardless of what type of frame it is. We should check the frame type in Flow.prototype.push before checking moreNeeded at all, so we don't end up blocking non-flow-controlled frames (I think).
I can whip up a patch for this, but I wanted to submit the issue to make sure I'm not crazy before doing the work :)
An endpoint MUST NOT send frames on a closed stream. An endpoint that receives any frame after receiving a RST_STREAM MUST treat that as a stream error of type STREAM_CLOSED instead of sending GOAWAY frame (draft-09, section 5.1)
A reserved 2-bit field. The semantics of these bits are undefined and the bits MUST remain unset when sending and MUST be ignored when receiving (draft-09, section 4.1)
Receipt of a PING frame with a length field value other than 8 MUST be treated as a connection error of type FRAME_SIZE_ERROR instead of PROTOCOL_ERROR (draft-09, section 6.7)
Receipt of a SETTINGS frame with the ACK flag set and a length field value other than 0 MUST be treated as a connection error of type FRAME_SIZE_ERROR (draft-09, section 6.5)
Recently we have built some HPACK test cases https://github.com/Jxck/hpack-test-case
I'd like to add node-http2 compressor to there. While doing that, I found a bug in HeaderTable.prototype._enforceLimit
. The code you should look at is:
droppedEntries[droppedEntries] = dropped;
droppedEntries
is an array and stores the dropped entries. But the above code sets itself as index, which is apparently a bug.
I suspect that it is dropPoint
, but I leave the fix for you. (I'm not really Nodejs guy)
The failed testcase is https://github.com/Jxck/hpack-test-case/blob/master/nghttp2/story_20.json When encoded by node-http2 compressor, at case #37 (1-based), it emits 2 empty name/value pairs.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.