Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

Commit

Permalink
http: Handle end only when stream is not dumped
Browse files Browse the repository at this point in the history
This fixes regression introduced in some cases by 8bf0c15
  • Loading branch information
isaacs committed Dec 26, 2012
1 parent 0db521d commit d76eacd
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/http.js
Expand Up @@ -160,7 +160,9 @@ function parserOnMessageComplete() {
stream._readableState.onread(null, null);
}

if (!stream._readableState.endEmitted && !parser.incoming._pendings.length) {
if (stream &&
!stream._readableState.endEmitted &&
!parser.incoming._pendings.length) {
// For emit end event
stream._readableState.onread(null, null);
}
Expand Down

1 comment on commit d76eacd

@shigeki
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@isaacs Thanks. I should have cared about it.

Please sign in to comment.