bneradt commented on PR #14019:
URL: https://github.com/apache/trafficserver/pull/14019#issuecomment-6774242373

   @maskit @bryancall Thanks to you both, and thanks for checking this against 
nghttp3. You're right on all of it. 97670b9b49 moves the decoder onto RFC 9204:
   
   - **Required Insert Count.** `decode()` reconstructs it from the encoded 
prefix per Section 4.5.1.1 when the block arrives, keeps it on the parked 
request, and passes it through `_decode()` and `_decode_header()`. An invalid 
encoding fails at once. `_is_blocked()` now compares it with the Insert Count 
(Section 2.2.1).
   - **Base and indices.** Base is `RIC + DeltaBase` or `RIC - DeltaBase - 1`, 
and sign 1 is rejected when RIC <= DeltaBase. A relative index names `Base - 1 
- i` and a post-base index names `Base + i`. A reference at or above the 
Required Insert Count fails (Section 2.2.3). `_encode_prefix()` writes the RFC 
form, so both sides agree.
   - **Encoder stream.** The table starts at capacity 0 (Section 3.2.3). A Set 
Dynamic Table Capacity above our advertised maximum, or an insert that doesn't 
fit, is now an encoder stream error that fails the parked decodes; the insert 
case used to be ignored silently. Duplicate treats its index as relative 
(Section 4.3.4), and a Section Acknowledgment goes out only for a non-zero 
Required Insert Count (Section 4.4.1).
   - **Tests.** They use RFC bytes and send `3f 61` first. Each encoding you 
listed is covered: `02 00 80` stays blocked, then decodes `first`. `03 00 80` 
waits after `first`, then decodes `second`. `01 00 80` fails at once. The 
Appendix B.2 bytes stay blocked after one insert, then resume after the second 
with `:authority` and `:path`. The abort case uses `02 00 80`, and the 
out-of-range static index is now 99, one past the end of the table. The 
`[qpack-encoder-stream]` cases use RFC prefixes too.
   - **XPACK bug.** Fixing this exposed a lookup bug in `XpackDynamicTable`: 
looking up any entry but the newest returned the wrong entry unless the table 
size was a power of two, because an unsigned offset wrapped in `_calc_index()`. 
B.2's 220-byte table hit it. That's fixed too, with an XPACK test.
   
   The resume fix, `_abort_decode()` failing every parked decode, and the 
header block copy are unchanged. I'll do the IOBufferBlock-reference version as 
a follow-up, including `Http3HeadersFrame::_parse()`.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to