0
0
mirror of https://github.com/nodejs/node.git synced 2024-12-01 16:10:02 +01:00
nodejs/lib
isaacs eafa902632 stream: Handle late 'readable' event listeners
In cases where a stream may have data added to the read queue before the
user adds a 'readable' event, there is never any indication that it's
time to start reading.

True, there's already data there, which the user would get if they
checked However, as we use 'readable' event listening as the signal to
start the flow of data with a read(0) call internally, we ought to
trigger the same effect (ie, emitting a 'readable' event) even if the
'readable' listener is added after the first emission.

To avoid confusing weirdness, only the *first* 'readable' event listener
is granted this privileged status.  After we've started the flow (or,
alerted the consumer that the flow has started) we don't need to start
it again.  At that point, it's the consumer's responsibility to consume
the stream.

Closes #5141
2013-03-28 10:27:18 -07:00
..
_debugger.js streams2: Call read(0) on resume() 2012-12-14 10:52:28 -08:00
_linklist.js
_stream_duplex.js stdio: Set readable/writable flags properly 2013-01-17 10:42:44 -08:00
_stream_passthrough.js stream: _write takes an encoding argument 2013-03-05 14:27:15 -08:00
_stream_readable.js stream: Handle late 'readable' event listeners 2013-03-28 10:27:18 -07:00
_stream_transform.js stream: Fix stall in Transform under very specific conditions 2013-03-21 17:49:12 -07:00
_stream_writable.js stream: Fix early end in Writables on zero-length writes 2013-03-24 14:23:21 -07:00
assert.js assert: improve support for new execution contexts 2012-12-29 11:19:14 -08:00
buffer.js buffer: check logic simplification 2013-02-20 20:34:34 +01:00
child_process.js child_process: don't emit same handle twice 2013-03-25 23:07:30 +01:00
cluster.js cluster: Rename destroy() to kill(signal=SIGTERM) 2013-03-03 17:26:38 -08:00
console.js console: Support formatting options in trace() 2013-01-18 15:39:08 -08:00
constants.js
crypto.js crypto: make getCiphers() return non-SSL ciphers 2013-03-25 18:42:07 +01:00
dgram.js child_process: support sending dgram socket 2013-03-07 17:51:17 +01:00
dns.js DNS: Support NAPTR queries 2013-03-06 14:31:22 +04:00
domain.js domain: fix domain callback from MakeCallback 2013-03-26 21:26:17 -07:00
events.js events: Handle missing error obj when domains in use 2013-03-10 09:53:24 -07:00
freelist.js
fs.js fs: make write/appendFileSync correctly set file mode 2013-03-20 01:37:43 +01:00
http.js http: Don't hot-path end() for large buffers 2013-03-14 08:04:59 -07:00
https.js https: optimize https.createConnection() 2012-12-28 16:42:51 +01:00
module.js core: Remove the nextTick for running the main file 2013-02-27 16:29:36 -08:00
net.js net: improve arbitrary tcp socket support 2013-03-14 15:55:30 +01:00
os.js os: rename tmpDir() to tmpdir() for consistency 2013-01-30 04:24:58 +01:00
path.js lint 2013-02-22 16:30:27 -08:00
punycode.js punycode: update to v1.2.0 2013-01-16 16:53:11 +01:00
querystring.js trivial: Doc typo and lint fix 2012-06-19 14:07:48 -07:00
readline.js events: add check for listeners length 2013-03-01 17:36:47 -08:00
repl.js make repl compatible with domains 2013-03-03 15:28:45 -08:00
stream.js events: add check for listeners length 2013-03-01 17:36:47 -08:00
string_decoder.js Don't allow invalid encodings in StringDecoder class 2012-12-13 17:00:22 -08:00
sys.js Fix #3577 Un-break require('sys') 2012-06-28 10:14:03 -07:00
timers.js timer: fix off-by-one ms error 2013-03-23 18:46:14 -07:00
tls.js tls: handle errors before calling C++ methods 2013-03-27 16:26:24 +04:00
tty.js lib, src: remove errno global 2013-02-28 23:11:47 +01:00
url.js url: make url.format escape delimiters in path and query 2012-10-30 09:16:13 -07:00
util.js node: Add --throw-deprecation 2013-03-06 11:44:29 -08:00
vm.js
zlib.js zlib: Manage flush flags appropriately 2013-03-08 18:56:31 -08:00