Skip to content

Commit

Permalink
tls: rename clientError to tlsClientError
Browse files Browse the repository at this point in the history
`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 <[email protected]>
  • Loading branch information
indutny committed Jan 7, 2016
1 parent f1653cc commit 1ab6b21
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion doc/api/tls.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -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) { }`

Expand Down
4 changes: 2 additions & 2 deletions lib/_tls_wrap.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
});
});
Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-tls-econnreset.js
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-tls-no-sslv3.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-tls-sni-option.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
});
Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-tls-timeout-server.js
Original file line number Diff line number Diff line change
Expand Up @@ -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++;
Expand Down

0 comments on commit 1ab6b21

Please sign in to comment.