molnarg / node-http2

An HTTP/2 client and server implementation for node.js
MIT License
1.79k stars 187 forks source link

AssertionError: Frame too large! in Node 6.3.0 when sending more than 2^14 bytes at once #207

Closed bjb568 closed 7 years ago

bjb568 commented 8 years ago

Using Node 6.3.0, this works:

let str = 'a';
for (let i = 0; i < 14; i++) str += str;
res.end(str);

But making it res.end(str + 'a'); makes it throw:

assert.js:89
  throw new assert.AssertionError({
  ^
AssertionError: Frame too large!
    at Serializer._transform (/Users/me/afolder/myproject/node_modules/http2/lib/protocol/framer.js:46:3)
    at Serializer.Transform._read (_stream_transform.js:167:10)
    at Serializer.Transform._write (_stream_transform.js:155:12)
    at doWrite (_stream_writable.js:307:12)
    at writeOrBuffer (_stream_writable.js:293:5)
    at Serializer.Writable.write (_stream_writable.js:220:11)
    at Compressor.ondata (_stream_readable.js:556:20)
    at emitOne (events.js:96:13)
    at Compressor.emit (events.js:188:7)
    at readableAddChunk (_stream_readable.js:177:18)

In Node 6.2.1 res.end(str + 'a'); works.

nwgh commented 7 years ago

What happens if you do res.end(str + 'aa') with node 6.3.0? What about newer versions of node (6.3.1 is available, for instance)? Normally I would say this sounds like an off-by-one error in node-http2, but given it works on some versions of node and not on others, I'm more suspicious.

bjb568 commented 7 years ago

res.end(str + 'aa') or any other string with more than 2^14 characters breaks on both 6.3.0 and 6.3.1.