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
Next Next commit
net: wait for shutdown to complete before closing
When not allowing half open, handle.close would be
invoked before shutdown has been called and
completed causing a potential data race.

Fixes: #32486 (comment)
  • Loading branch information
ronag committed Mar 25, 2020
commit 3bf1c0801462d41585c1295d9fb5d8d579f2f1a9
6 changes: 3 additions & 3 deletions lib/net.js
Original file line number Diff line number Diff line change
Expand Up @@ -630,9 +630,9 @@ function onReadableStreamEnd() {
this.write = writeAfterFIN;
if (this.writable)
this.end();
}

if (!this.destroyed && !this.writable && !this.writableLength)
else if (!this.writableLength)
this.destroy();
} else if (!this.destroyed && !this.writable && !this.writableLength)
this.destroy();
}

Expand Down