You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.
It will fire as a _tlsError immediately while in the constructor instead of either throwing an error (if there were no error handlers) or waiting till the next tick to fire the _tlsError.
This can be solved by wrapping this._init(socket) in a process.nextTick or delaying:
// Socket already has some buffered data - emulate receiving it
if (socket && socket._readableState.length) {
var buf;
while ((buf = socket.read()) !== null)
this.ssl.receive(buf);
}
A third option could also be to not immediately add an error listener in the constructor.
It seems like the second option (delaying the initial buffer read) is better but let me know what you guys think.
The text was updated successfully, but these errors were encountered:
If you pass a socket with already buffered data to TLSSocket and there's an error like:
It will fire as a
_tlsError
immediately while in the constructor instead of either throwing an error (if there were no error handlers) or waiting till the next tick to fire the_tlsError
.This can be solved by wrapping
this._init(socket)
in aprocess.nextTick
or delaying:A third option could also be to not immediately add an
error
listener in the constructor.It seems like the second option (delaying the initial buffer read) is better but let me know what you guys think.
The text was updated successfully, but these errors were encountered: