Permalink
Browse files

just emit the ack since the stream is already available if listenin f…

…or streamConnect
  • Loading branch information...
substack committed Feb 3, 2012
1 parent f2101ef commit f71a31b3d8441dc882b234b281754a269eb9ff05
Showing with 6 additions and 6 deletions.
  1. +1 −1 index.js
  2. +5 −5 test/tls.js
View
@@ -51,7 +51,7 @@ exports.connect = function () {
if (--pending === 0) done();
}
};
- stream.emit('secureConnect', stream, ack);
+ stream.emit('secureConnect', ack);
}
function done () {
View
@@ -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();
});
});
@@ -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()
});
});

0 comments on commit f71a31b

Please sign in to comment.