Skip to content

Commit 648b1d0

Browse files
committed
Passes test-cases again, without hanging the test suite.
The fix for it is not as elegant as I would have hoped but it does the job, preventing un-needed listeners to be added on the connections.
1 parent 63624e5 commit 648b1d0

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lib/socket.io/client.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,9 @@ Client.prototype._onConnect = function(req, res){
6767
this.request = req;
6868
this.response = res;
6969
this.connection = req.connection;
70+
71+
if(!attachConnection) attachConnection = !attachConnection && this.connection.eventsAttached === undefined;
72+
this.connection.eventsAttached = true;
7073

7174
if (attachConnection){
7275
this.connection.addListener('end', function(){
@@ -102,6 +105,7 @@ Client.prototype._onConnect = function(req, res){
102105
}
103106
};
104107

108+
105109
Client.prototype._payload = function(){
106110
var payload = [];
107111

0 commit comments

Comments
 (0)