-
Notifications
You must be signed in to change notification settings - Fork 26
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
Is there any way to set dynamic table size limit to mitigate TooSmallTableSize decode error? #65
Comments
Hi Andrey, what type of server are you communicating with? can you get queries with There's a cURL-like utility to help exercising the library: http2-client-exe . If you can reproduce and post a trace with If i remember correctly that could happen if the remote is changing settings too low. That error seems to come from HPACK in the http2 library directly. I'll try to dig a bit further, but won't have time before the week-end. |
Hi Lucas, Thank you for quick response! I will try to reproduce the issue with Yes, exactly, the error came from HPACK and to be precisely either from decodeHeader or from decodeTokenHeader. Please expect update shortly. Thanks and Regards, |
Issue reproduced with
|
OK, I will try to clone |
Thanks @swamp-agr ! we've narrowed that down to the library and not you "using it wrong". I don't see settings changes for SETTINGS_HEADER_TABLE_SIZE exchanged, so it feels like the server not honoring the default 4K size (or maybe some bug in |
Alternatively, the issue is within the HPACK code itself: HPACK has its own "protocol-like" within HTTP2 HEADERS frame, but so far I've always treated this part as a black-box and Kazu is probably your man (time to step up my game I guess :-)). |
@lucasdicioccio, many thanks for clarification. I will share with you my findings. |
I think, I have a clue. Analysing why Note.
@lucasdicioccio, could you please suggest further steps? Thanks, |
I added some printers to |
Separate issue created for |
After some research it was determined that 1st bit of failing bytestring is a priority flag
Let me analyse how to handle |
I'll have a bit more time late today or tomorrow to setup a proper "lab-like example". Thanks a lot for these investigations! At the moment I think two broad things can occur:
Further, the semantics of PRIORITY is likely not the culprit: they should just be ignored and help sequencing streams -- which we don't do yet. One thing interesting is that http2-client sees a payloadLength of 55bytes for the HEADERS frame Tomorrow I'll try to decode the 55bytes in your headers payload using HPACK decoder in a GHCi session. Also, encoding the 458bytes of the headers seen by curl. These will give us a lot of insights |
Hi Lucas, Thank you for explanation!
Actually here I am a bit stucked.
Hope, it might help. Thanks, |
Here is the same test for
Here are also |
For test of |
Frame Payload:
Let me analyze HPACK RFC to try to determine what is the correct approach for HPACK decoding. |
I am wondering, how does it relate to
where
|
That's a lot of information. I think you're doing great progress and you're definitely ahead of me in this debug session If I understand well, the problem is indeed inside I'll try to debug that on my own as well but please keep scratching because you probably already know more about HPACK than myself :-). I barely know that there's an hpack tests suite at https://github.com/http2jp/hpack-test-case but I've not been using it. |
Hi Lucas, I don't know yet what is causing the issue, so I will step back and try to decode According to RFC 7540,
and its Paylaod:
Only |
At the moment, my suspicions are on the I'm debugging with
In a binary run with
In GHCi, when stepping through the debugger and adding a few That's about where I am at the moment. |
OK, I got it and it's related to your comment about dynamic table update at By adding a special case
I then properly decode the bytestring as
|
So now we need Kazu's lights to help us understand whether this is something unclear in RFC 7541, in nginx's implementation, or in That was an epic bug-chase. |
@swamp-agr , for now you can try this patch:
in Network/HPACK/Table/Dynamic.hs and see if there are more troubles down the road (because HPACK is inherently stateful, we cannot conclude anything from a simple workaround). We can have a quick chat if you want to help continuing debugging this issue on the |
Lets use this comment as a summary. problem
This binary header-block-fragment seems correct because The analysisThe error seems to occur in In
Then, the following happens: In
At tha point The rest of the bytestring gets consumed, which leads to decoding with |
Cool, I think it's better to reopen issue I previously created. I will rename it to address it to |
I tested patch and it works fine for all cases. |
Lucas, many thanks for your suggestion! 🥇 Right now I am unblocked with further tests. I think this issue might be closed. We will move on Thank you, |
Thanks for reporting the issue and the willingness to get to the bottom of it. You rock! :-) |
Yeah, sure, I will follow |
Hi, @lucasdicioccio!
I am trying to invoke GET query with http2-client and constantly receive:
Could you please advise how to tweak the dynamic table size limit?
Upd. Length of
:path
value is equal to 193.Thanks,
@swamp-agr
The text was updated successfully, but these errors were encountered: