-
Notifications
You must be signed in to change notification settings - Fork 195
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
TypeError: Cannot read property 'incoming' of null #252
Comments
The problem is occasionally the ServerResponse is sent (and ended) before the push. After the ServerResponse has ended, the parser is gone (and probably other things, too). This isn't a bug in the spdy module (although being able to push without depending on a ServerResponse object would be helpful). But, I think this caveat should probably be mentioned in the documentation. |
I seem to have a similar problem where in the underlying socket is closed and cleaned up, before the push stream is created. The way I see it, the culprit is this line: https://github.com/indutny/node-spdy/blob/master/lib/spdy/response.js#L83 Instead of depending on the parser to reference the IncomingMessage to grab the hostname, perhaps it would be better to use an alternate way of grabbing the hostname. Looking at https://github.com/indutny/node-spdy/blob/master/lib/spdy/server.js, it seems that a cleaner way to reference the request would be to get the request and response to reference each other (perhaps a weak reference, if needed; not sure of the dynamics there). Something like the following in https://github.com/indutny/node-spdy/blob/master/lib/spdy/server.js#L229-L238
With this in place, Does that seem alright @indutny? |
I'm using node-spdy 3.2.3 on node 5.8.0. After pushing a couple files, spdy fails with this error.
lib\spdy\response.js
I'm calling push() like this:
If I step into res.push(),
this
is the ServerResponse object andsocket
is a Socket object, butparser
is null.The text was updated successfully, but these errors were encountered: