Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
fixup! tls: account for buffered data before creating TLSSocket wrap
  • Loading branch information
addaleax committed Oct 6, 2020
commit 52863d56a12a01dd6155c3778ce15dc602c4ce68
5 changes: 3 additions & 2 deletions lib/_tls_wrap.js
Original file line number Diff line number Diff line change
Expand Up @@ -481,8 +481,9 @@ function TLSSocket(socket, opts) {
let wrap;
// Ideally, the readableLength check would not be necessary, and we would
// have a way to handle the buffered data at the C++ StreamBase level.
if (((socket instanceof net.Socket && socket._handle) || !socket) &&
socket.readableLength === 0) {
if ((socket instanceof net.Socket &&
socket._handle &&
socket.readableLength === 0) || !socket) {
// 1. connected socket
// 2. no socket, one will be created with net.Socket().connect
wrap = socket;
Expand Down