Skip to content
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

Double Disconnect #7

Closed
wants to merge 2 commits into from
Closed

Conversation

benlangfeld
Copy link
Contributor

Ok, so I found the issue causing this bug: http://github.com/metajack/strophejs/issues#issue/2

If more than one connection is allowed, the terminate/unavailable stanza is sent on a new connection, which gets a terminate response. There is still another open connection, however, so instead of the final part of closing a connection being performed:

    // handle graceful disconnect
    if (this.disconnecting && this._requests.length === 0) {
        this.deleteTimedHandler(this._disconnectTimeout);
        this._disconnectTimeout = null;
        this._doDisconnect();
        return;
    }

We actually consider the terminate response to be a connection error. In order to handle this correctly, we need to cease considering this as an error, by testing if a disconnect is in progress.

@metajack
Copy link
Owner

metajack commented Nov 9, 2010

Thanks for this fix. I added a comment and merge your changes.

This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants