Skip to content

Commit c5a5131

Browse files
committed
msg.finished is only finished if socket has been detached
1 parent 08345db commit c5a5131

File tree

2 files changed

+1529
-1
lines changed

2 files changed

+1529
-1
lines changed

index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ function isFinished (msg) {
6767

6868
if (typeof msg.finished === 'boolean') {
6969
// OutgoingMessage
70-
return Boolean(msg.finished || (socket && !socket.writable))
70+
return Boolean((!socket && msg.finished && msg.outputSize === 0) || (socket && !socket.writable) || (msg.stream && msg.stream.closed))
7171
}
7272

7373
if (typeof msg.complete === 'boolean') {

0 commit comments

Comments
 (0)