Skip to content

Commit

Permalink
patched to properly shut down when a finishClose call is made during …
Browse files Browse the repository at this point in the history
…connection establishment
  • Loading branch information
einaros committed Oct 8, 2011
1 parent aba2d5e commit 08568ee
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions support/node-websocket-client/lib/websocket.js
Original file line number Diff line number Diff line change
Expand Up @@ -494,6 +494,13 @@ var WebSocket = function(url, proto, opts) {
return function(req, s, head) {
stream = s;

if (readyState == CLOSED) {
stream.end();
stream.destroy();
stream = undefined;
return;
}

stream.on('data', function(d) {
if (d.length <= 0) {
return;
Expand Down

0 comments on commit 08568ee

Please sign in to comment.