Commit a0224f3
authored
Discard read bytes when accumulating continuation frames (#444)
Motivation:
When accumulating sequences of CONTINUATION frames, each frame is parsed
from a buffer. These bytes are read when the CONTINUATION frame is
parsed, but if more CONTINUATION frames follow then the buffer isn't
reset. This means that long sequences of CONTINUATION frames can result
in a larger than necessary buffer where most of the contents have
already been read.
Modifications:
- Discard the bytes of the accumulation buffer when transitioning back
to AccumulatingHeaderBlockFragmentsParserState if more than half of
the buffer has been read.
Result:
Lower memory footprint when parsing sequences of CONTINUATION frames.1 parent 6af2cf6 commit a0224f3
1 file changed
+13
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
537 | 537 | | |
538 | 538 | | |
539 | 539 | | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
540 | 553 | | |
541 | 554 | | |
542 | 555 | | |
| |||
0 commit comments