mirror of
https://github.com/nodejs/node.git
synced 2026-11-26 21:58:26 -05:00
tls: handle error events with _tlsError
Previously `TLSSocket#_emitTLSError` was used as an `error` event handler. However that function can emit `error` event itself, so it is not suitable for such use. Luckily the event can be emitted only when the control is released, so this looping-error can't happen. Replace the error handler for clarity and correctness. PR-URL: https://github.com/nodejs/node/pull/8889 Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
This commit is contained in:
1 parent
c36c8dc3cc
commit
bee1955f4e
1 file changed
+2
-2
+2
-2
@@ -272,7 +272,7 @@ function TLSSocket(socket, options) {
|
||||
// Proxy for API compatibility
|
||||
this.ssl = this._handle;
|
||||
|
||||
this.on('error', this._emitTLSError);
|
||||
this.on('error', this._tlsError);
|
||||
|
||||
this._init(socket, wrap);
|
||||
|
||||
@@ -554,7 +554,7 @@ TLSSocket.prototype._releaseControl = function() {
|
||||
if (this._controlReleased)
|
||||
return false;
|
||||
this._controlReleased = true;
|
||||
this.removeListener('error', this._emitTLSError);
|
||||
this.removeListener('error', this._tlsError);
|
||||
return true;
|
||||
};
|
||||
|
||||
|
||||
Reference in new issue
Block a user