Bug 1170645. Don't try to RemoveFromQueue websocket channels that are not queued. r=jduell
--- a/netwerk/protocol/websocket/WebSocketChannel.cpp
+++ b/netwerk/protocol/websocket/WebSocketChannel.cpp
@@ -421,21 +421,23 @@ public:
if (aChannel->mConnecting) {
// Only way a connecting channel may get here w/o failing is if it was
// closed with GOING_AWAY (1001) because of navigation, tab close, etc.
MOZ_ASSERT(NS_FAILED(aReason) ||
aChannel->mScriptCloseCode == CLOSE_GOING_AWAY,
"websocket closed while connecting w/o failing?");
- sManager->RemoveFromQueue(aChannel);
-
- bool wasNotQueued = (aChannel->mConnecting != CONNECTING_QUEUED);
+ bool wasQueued = (aChannel->mConnecting == CONNECTING_QUEUED);
+ if (wasQueued) {
+ sManager->RemoveFromQueue(aChannel);
+ }
+
aChannel->mConnecting = NOT_CONNECTING;
- if (wasNotQueued) {
+ if (!wasQueued) {
sManager->ConnectNext(aChannel->mAddress);
}
}
}
static void IncrementSessionCount()
{
StaticMutexAutoLock lock(sLock);