Skip to content

Commit

Permalink
just emit the ack since the stream is already available if listenin f…
Browse files Browse the repository at this point in the history
…or streamConnect
  • Loading branch information
James Halliday committed Feb 3, 2012
1 parent f2101ef commit f71a31b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion index.js
Expand Up @@ -51,7 +51,7 @@ exports.connect = function () {
if (--pending === 0) done();
}
};
stream.emit('secureConnect', stream, ack);
stream.emit('secureConnect', ack);
}

function done () {
Expand Down
10 changes: 5 additions & 5 deletions test/tls.js
Expand Up @@ -56,8 +56,8 @@ test('TLS - unauthorized with callback', {timeout: 1000}, function(t) {
})
});

c.on('secureConnect', function (s, ack) {
t.ok(!s.authorized);
c.on('secureConnect', function (ack) {
t.ok(!c.authorized);
ack.accept();
});
});
Expand All @@ -81,9 +81,9 @@ test('TLS - authorized', {timeout: 1000}, function(t) {
})
});

c.on('secureConnect', function (s, ack) {
t.ok(s.authorized, "should be authorized");
if (s.authorized) ack.accept()
c.on('secureConnect', function (ack) {
t.ok(c.authorized, "should be authorized");
if (c.authorized) ack.accept()
else ack.reject()
});
});
Expand Down

0 comments on commit f71a31b

Please sign in to comment.