-
-
Notifications
You must be signed in to change notification settings - Fork 42
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
onFinished(res) may trigger early #10
Comments
Funny enough, the line at https://github.com/joyent/node/blob/v0.10.32/lib/http.js#L1116 was not added until 0.10.0, so it means all versions before that (0.9.x and 0.8.x) are subtly broken -____- |
You mean those versions just don't act correctly in the first place? |
Related commit: nodejs/node-v0.x-archive@e2400f8 Related issue: nodejs/node-v0.x-archive#4967 Well, that's kinda how fixes work sometimes. :| |
Right. It seems that it was decided a bug was not to be fixed until the next feature version, but that feature version was even released. I could see if it was after 0.10 was released, but whatever. Node.js doesn't always make the best support decisions, lol |
Anyway, I could monkey-patch |
@dougwilson is it that this module is broken on those, or just the edge case that this fixes? |
This module is 100% broken when pipelined requests come in faster than they are handled. But as far as monkey-patching, I really mean I don't want to unless there is a feature-detection I can use to restrict it only to 0.8 |
Like, does the second part affect the module as a whole, or is it just that this issue cannot be fixed on 0.8? If it's the latter, I think poking people to upgrade if they happen to encounter it is a better option. |
@dougwilson though it looks like you can the node version in-code via |
I already pushed the version that works perfectly on 0.8, it's just lame. I noticed something I can use to feature detect that it'll emit the socket event.
Yea, and I make web sites that look in |
So apparently there was a false assumption on the already-finished detection of
OutgoingMessage
that thesocket
property will always be populated. From https://github.com/joyent/node/blob/v0.10.32/lib/http.js#L455 in 0.10 (0.8 is similar),socket
is not assigned toOutgoingMessage
until a later time in the cycle. I believe this occurs with pipelined requests, from reading the Node.js source code, which would explain why it's rarely seen (most things have pipelining turned off and doing things like putting Node.js behind nginx will prevent pipelining from reaching Node.js).The text was updated successfully, but these errors were encountered: