News for hackers. Stuff that matters.
Re:The Case of the 50ms request by spuz on Thursday May 06, 2021 @05:16AM (#27060807)
Ok, I think that would have helped me learn that the client can some how trigger the bug but I don't think it would have allowed me to narrow it down to flushHeaders.
Re:The Case of the 50ms request by gizmo on Thursday May 06, 2021 @06:56AM (#27061408)
There is no such thing as flushing a TCP socket which is why that function jumped out at me. curl would have confirmed the server isn't misbehaving. Googling flushHeaders shows it's a node implementation specific thing and the docs explain that it has to do with the way node buffers http headers. Which makes sense because you don't want to call socket.send() for every http header you add to your request. But you also don't want to send() in between your headers and the body, because then you violate TCP package size expectations.