Permalink
Browse files

Fix in close() triggering via error states. I think it's due to 'end'…

… firing twice
  • Loading branch information...
1 parent 2c0cd4d commit 777b4355ae1dfac5c2c7f27955d6d5361b879b29 @miksago committed Dec 2, 2010
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/ws/connection.js
View
2 lib/ws/connection.js
@@ -69,7 +69,7 @@ function Connection(manager, options, req, socket, upgradeHead) {
parser.write(_firstFrame);
delete _firstFrame;
}
- } else if (state === 5) {
+ } else if (state === 5 && laststate !== 6 && laststate !== 5) {
close(connection);
} else if (state === 6 && laststate === 5) {
manager.detach(connection);

0 comments on commit 777b435

Please sign in to comment.