Closed jonathanong closed 10 years ago
okay it seems like somewhere res.socket = null
is being set after the response is finished. is there a reason for that?
I think yes, there is a reason for it. That's a behavior of node.js and it is unlikely to change.
Could you please remove unrelevant changes in your patch?
And add test, perhaps?
which parts are unrelevant? the stream
stuff is a scoping error. putting the new Error
in the next tick unnecessarily destroys the stack trace
Convinced, landed in de057d1 :) Thank you!
not sure why this is, but sometimes
this.socket
is empty. seems like it sometimes exists onreq
but notres
.currently, the code is borked because you have a
stream
variable inside.push()
as well as outside. now, the error is properly emitted.also moved the error outside the next tick so there's a proper stack trace