Skip to content

Commit

Permalink
net: fix readable event not emitted (fixes #25969)
Browse files Browse the repository at this point in the history
fix readable event not emitted  after reconnect

Fixes: #25969
  • Loading branch information
CGQAQ committed Jul 21, 2023
1 parent 4ee4718 commit 1bb06be
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/net.js
Original file line number Diff line number Diff line change
Expand Up @@ -1582,8 +1582,10 @@ function afterConnect(status, handle, req, readable, writable) {

// Start the first read, or get an immediate EOF.
// this doesn't actually consume any bytes, because len=0.
if (readable && !self.isPaused())
if (readable) {
self.read(0);
}

if (self[kPerfHooksNetConnectContext] && hasObserver('net')) {
stopPerf(self, kPerfHooksNetConnectContext);
}
Expand Down

0 comments on commit 1bb06be

Please sign in to comment.