-
Notifications
You must be signed in to change notification settings - Fork 597
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
fix: reset socket on GET & HEAD with body #250
Conversation
ad48105
to
e59b4b9
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
This probably should be written somewhere in the README as it's more strict compared to Node core.
@mcollina How strongly do you feel in regards to "semversiness" on this? |
If we were crashing with GET and HEAD with a body before, it's a patch. |
Added a "notes" section in the docs, documenting this. |
I suggest adding an option to disable this. At Got we had bunch of issues complaining about this behavior. Otherwise looks good :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this happening only if pipelining is higher than 1? In such case we could allow sending a body if pipeline is 1 and throw it is higher than 1.
What do you think?
I agree, but that still doesn't fix the issue. |
It happens when the connection is re-used. Should probably clarify. This might actually be a problem in Node core as well. Just harder to hit. |
An alternative solution is to only send the request when nothing else is running, not send any further requests while it's running, and reconnect once the first response has been received. |
6e42f53
to
be8d06d
Compare
@delvedor @mcollina @szmarczak PTAL. I think this might be a better solution, i.e. don't allow any other running requests and reset the socket after the first response. |
1efb8ae
to
0ccbaff
Compare
9e646f0
to
b16318f
Compare
8d4b2b1
to
e25c9af
Compare
4f848c3
to
56d2829
Compare
408ddd7
to
ff3d53f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
Just a part of my comment from #258 (comment)
What about this? |
I don't think responses contain the path? i.e. at least the http_parser does not provide it. |
If the data seems legit (looks like a HTTP/1.1 request), then you can check the path ( And if it doesn't match the pipelined request or there is none just simply reconnect. |
url is only set for requests, not responses |
Oooooh I was so confused for a while 😂 You're totally right. Pardon me. |
Fixes: #246