Skip to content
Permalink
Browse files

tls: rename `clientError` to `tlsClientError`

`clientError` will have `http.Server`-specific behavior, and we don't
want to shadow it in `tls.Server`.

PR-URL: #4557
Reviewed-By: Brian White <mscdex@mscdex.net>
  • Loading branch information...
indutny committed Jan 6, 2016
1 parent f1653cc commit 1ab6b21360d97719b3101153fb164c0c3eddf038
@@ -169,7 +169,7 @@ This class is a subclass of `net.Server` and has the same methods on it.
Instead of accepting just raw TCP connections, this accepts encrypted
connections using TLS or SSL.

### Event: 'clientError'
### Event: 'tlsClientError'

`function (exception, tlsSocket) { }`

@@ -809,14 +809,14 @@ function Server(/* [options], listener */) {
errorEmitted = true;
var connReset = new Error('socket hang up');
connReset.code = 'ECONNRESET';
self.emit('clientError', connReset, socket);
self.emit('tlsClientError', connReset, socket);
}
});

socket.on('_tlsError', function(err) {
if (!socket._controlReleased && !errorEmitted) {
errorEmitted = true;
self.emit('clientError', err, socket);
self.emit('tlsClientError', err, socket);
}
});
});
@@ -48,7 +48,7 @@ var connectError = null;

var server = tls.createServer({ ca: ca, cert: cert, key: key }, function(conn) {
throw 'unreachable';
}).on('clientError', function(err, conn) {
}).on('tlsClientError', function(err, conn) {
assert(!clientError && conn);
clientError = err;
}).listen(common.PORT, function() {
@@ -48,7 +48,7 @@ server.listen(common.PORT, '127.0.0.1', function() {
}));
});

server.on('clientError', err => errors.push(err));
server.on('tlsClientError', err => errors.push(err));

process.on('exit', function() {
if (/unknown option -ssl3/.test(stderr)) {
@@ -110,7 +110,7 @@ var server = tls.createServer(serverOptions, function(c) {
serverResults.push({ sni: c.servername, authorized: c.authorized });
});

server.on('clientError', function(err) {
server.on('tlsClientError', function(err) {
serverResults.push(null);
serverError = err.message;
});
@@ -25,7 +25,7 @@ var options = {

var server = tls.createServer(options, common.fail);

server.on('clientError', function(err, conn) {
server.on('tlsClientError', function(err, conn) {
conn.destroy();
server.close();
clientErrors++;

0 comments on commit 1ab6b21

Please sign in to comment.
You can’t perform that action at this time.