Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

didClose of null traceback #91

Closed
majek opened this Issue · 3 comments

2 participants

@majek
Owner

@darklrd pasted a tracback on a mailing list
https://groups.google.com/group/sockjs/msg/9e669b9decfe6a75

Exception on "POST /chat/048/zhsj82kx/xhr_send" in filter "xhr_send":
TypeError: Cannot call method 'didClose' of null
    at Session.close (../node_modules/sockjs/lib/transport.js:226:19)
    at SockJSConnection.close (../node_modules/sockjs/lib/transport.js:58:28)
    at SockJSConnection.end (../node_modules/sockjs/lib/transport.js:53:12)
    at SockJSConnection.sockjs_server.on.socket.on.custom_disconnect (../XXXX.js:YYYY:ZZ)
    at SockJSConnection.EventEmitter.emit (events.js:93:17)
    at Session.didMessage (../node_modules/sockjs/lib/transport.js:207:25)
    at App.exports.app.xhr_send (../node_modules/sockjs/lib/trans-xhr.js:81:15)
    at execute_request (../node_modules/sockjs/lib/webjs.js:21:38)
    at exports.generateHandler.req.next_filter (../node_modules/sockjs/lib/webjs.js:95:18)
    at IncomingMessage.exports.GenericApp.GenericApp.expect_xhr.status (../node_modules/sockjs/lib/webjs.js:272:16)

@darklrd

Thanks Marek.

@majek
Owner

What happens here is:
1) we receive data from the stack
2) you call your custom_disconnect
3) during the callback you call connection.end() on sockjs
4) it calls session.close in sockjs code
5) which runs this code:

      if (this.recv) {
        this.recv.doSendFrame(this.close_frame);
        this.recv.didClose();   <--- this.recv is null

but two lines above it wasn't null. So doSendFrame must have cleared the this.recv, and indeed, that's what happens.

@darklrd

I see. Thank you for the explanation. From the name it seems doSendFrame() is trying to send a "close" message to client side.

@majek majek closed this issue from a commit
@majek majek Fix #91 - in some rare corner cases, for *-streaming closing might ha…
…ve triggered null exception

Basically, when the close frame went above the data-per-straming connection limit.
81ce634
@majek majek closed this in 81ce634
@majek majek referenced this issue from a commit
@majek majek Fix #91 - in some rare corner cases, for *-streaming closing might ha…
…ve triggered null exception

Basically, when the close frame went above the data-per-straming connection limit.
8f245ed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.