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

stream: Writable.end(chunk) after end is an error #4904

Closed
wants to merge 1 commit into from

Conversation

isaacs
Copy link

@isaacs isaacs commented Mar 3, 2013

Calling end(data) calls write(data). Doing this after end should
raise a 'write after end' error.

However, because end() calls were previously ignored on already
ended streams, this error was confusingly suppressed, even though the
data never is written, and cannot get to the other side.

This is a re-hash of 5222d19, but
without assuming that the data passed to end() is valid, and thus
breaking a bunch of tests.

The relevant diff from that commit is https://gist.github.com/isaacs/5074143

Calling end(data) calls write(data).  Doing this after end should
raise a 'write after end' error.

However, because end() calls were previously ignored on already
ended streams, this error was confusingly suppressed, even though the
data never is written, and cannot get to the other side.

This is a re-hash of 5222d19, but
without assuming that the data passed to end() is valid, and thus
breaking a bunch of tests.
isaacs referenced this pull request Mar 3, 2013
Calling end(data) calls write(data).  Doing this after end should
raise a 'write after end' error.

However, because end() calls were previously ignored on already
ended streams, this error was confusingly suppressed, even though the
data never is written, and cannot get to the other side.
@bnoordhuis
Copy link
Member

LGTM and tests seem to pass.

@isaacs
Copy link
Author

isaacs commented Mar 4, 2013

Landed in master. Thanks.

@isaacs isaacs closed this Mar 4, 2013
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants