0
0
mirror of https://github.com/nodejs/node.git synced 2024-12-01 16:10:02 +01:00
Cross-platform JavaScript runtime environment https://nodejs.org/
Go to file
isaacs 327b6e3e1d stream: Don't emit 'end' unless read() called
This solves the problem of calling `readable.pipe(writable)` after the
readable stream has already emitted 'end', as often is the case when
writing simple HTTP proxies.

The spirit of streams2 is that things will work properly, even if you
don't set them up right away on the first tick.

This approach breaks down, however, because pipe()ing from an ended
readable will just do nothing.  No more data will ever arrive, and the
writable will hang open forever never being ended.

However, that does not solve the case of adding a `on('end')` listener
after the stream has received the EOF chunk, if it was the first chunk
received (and thus, length was 0, and 'end' got emitted).  So, with
this, we defer the 'end' event emission until the read() function is
called.

Also, in pipe(), if the source has emitted 'end' already, we call the
cleanup/onend function on nextTick.  Piping from an already-ended stream
is thus the same as piping from a stream that is in the process of
ending.

Updates many tests that were relying on 'end' coming immediately, even
though they never read() from the req.

Fix #4942
2013-03-10 11:08:22 -07:00
benchmark bench: Do math on numbers in compare.js, not strings 2013-03-07 11:56:53 -08:00
deps uv: Upgrade to 5462dab 2013-03-09 18:34:59 -08:00
doc Merge remote-tracking branch 'ry/v0.8' into master 2013-03-08 18:59:44 -08:00
lib stream: Don't emit 'end' unless read() called 2013-03-10 11:08:22 -07:00
src domain: Fix double-exit on nested domains 2013-03-09 07:00:21 -08:00
test stream: Don't emit 'end' unless read() called 2013-03-10 11:08:22 -07:00
tools win/msi: Fix typos 2013-03-09 09:22:00 -08:00
.gitattributes
.gitignore tools: Add wrk for benchmarking http servers 2013-02-19 17:16:18 -08:00
.mailmap Update AUTHORS and .mailmap 2012-10-10 23:14:55 +02:00
.travis.yml test: add .travis.yml for testing on Travis CI 2011-12-05 16:50:55 -08:00
AUTHORS 2013.03.07, Version 0.8.22 (Stable) 2013-03-06 15:47:29 -08:00
BSDmakefile
ChangeLog Merge remote-tracking branch 'ry/v0.8' into master 2013-03-08 18:59:44 -08:00
common.gypi Revert "build, windows: disable SEH" 2013-03-08 12:43:58 +01:00
configure configure: define "arm_fpu" and "arm_neon" for ARM 2013-01-10 17:13:59 -08:00
CONTRIBUTING.md doc: add tools/ dir to CONTRIBUTING.md verboten list 2013-02-14 12:42:57 +01:00
LICENSE doc: Add wrk's license to LICENSE file 2013-03-08 13:47:36 -08:00
Makefile build: define nightly tag external to build system 2013-03-05 14:43:27 -08:00
node.gyp Revert "sunos: unbreak build after v8 downgrade" 2013-02-26 07:57:12 +00:00
README.md doc: document PYTHON env var in README 2013-01-22 13:53:49 +01:00
vcbuild.bat build: define nightly tag external to build system 2013-03-05 14:43:27 -08:00

Evented I/O for V8 javascript. Build Status

To build:

Prerequisites (Unix only):

* Python 2.6 or 2.7
* GNU Make 3.81 or newer
* libexecinfo (FreeBSD and OpenBSD only)

Unix/Macintosh:

./configure
make
make install

If your python binary is in a non-standard location or has a non-standard name, run the following instead:

export PYTHON=/path/to/python
$PYTHON ./configure
make
make install

Windows:

vcbuild.bat

To run the tests:

Unix/Macintosh:

make test

Windows:

vcbuild.bat test

To build the documentation:

make doc

To read the documentation:

man doc/node.1

Resources for Newcomers