Closed jrconlin closed 2 years ago
@jrconlin I see 64 here, https://docs.rs/httparse/1.3.4/httparse/constant.EMPTY_HEADER.html#example
Is there anywhere else 16 is listed, beyond the README.md, that you're aware of?
Not that I'm aware of, no. However, I've not really done a very deep dive to investigate. It's my guess that we used 16
mostly from the README example, but it's been a while and folks forgot where they got the number.
Got the same problem too. The fact that Chrome sent more headers than cURL and exceeded the pre-allocated number of headers really confused us for a while.
tldr: Please change the documentation demo line from
to
This is a really silly bug that bit us.
Our server uses httparse. Since we weren't quite sure how many headers we needed to pre-allocate, we used the demo code's suggested 16 headers. Unfortunately, with work going on around the new
Sec-*
headers, we suddenly saw a spike of clients trying to connect with 17 headers. It took us a bit to figure out what was going on and why these connections were mysteriously failing.Boosting the count might help others not suddenly hit this problem.