isaacs
44b308b1f7
fs: streams2
12 years ago
isaacs
d58f2654bc
streams2: Unpipe on dest.emit('close')
12 years ago
isaacs
49ea653363
streams2: Remove pipe if the dest emits error
12 years ago
isaacs
ac5a185edf
streams2: Handle pipeChunkSize properly
12 years ago
isaacs
53fa66d9f7
streams2: Set 'readable' flag on Readable streams
12 years ago
isaacs
4b4ff2dff1
streams2: Refactor out .once() usage from Readable.pipe()
12 years ago
isaacs
38e2b0053a
streams2: Get rid of .once() usage in Readable.pipe
Significant performance impact
12 years ago
isaacs
b15e19a232
streams2: Remove function.bind() usage
It's too slow, unfortunately.
12 years ago
isaacs
2ff499c022
streams2: Do multipipe without always using forEach
The Array.forEach call is too expensive.
12 years ago
isaacs
0118584433
streams2: Writable organization, add 'finishing' flag
12 years ago
isaacs
286c54439a
streams2: Only emit 'readable' when needed
12 years ago
isaacs
62dd04027b
streams2: Set Readable lwm to 0 by default
12 years ago
isaacs
f20fd22abd
streams2: Add high water mark for Readable
Also, organize the numeric settings a bit on the ReadableState class
12 years ago
isaacs
63ac07b32b
streams2: Export Readable/Writable State classes
12 years ago
isaacs
5856823223
streams2: Fix duplex no-half-open logic
12 years ago
isaacs
286aa04910
streams2: Abstract out onread function
12 years ago
isaacs
f624ccb475
streams2: Use StringDecoder.end
12 years ago
isaacs
cf0b4ba410
streams2: flow() is not always bound to src
12 years ago
isaacs
e82d06bef9
streams2: Fix regression from Duplex ctor assignment
12 years ago
isaacs
71e2b61388
streams2: Support write(chunk,[encoding],[callback])
12 years ago
isaacs
0678480b57
streams2: Allow Writables to opt out of pre-buffer-izing
12 years ago
isaacs
545f512619
streams2: ctor guards on Stream classes
12 years ago
isaacs
8acb416ad0
streams2: Handle immediate synthetic transforms properly
12 years ago
isaacs
06e321d0f9
streams2: Correct drain/return logic
It was testing the length *before* adding the current chunk, which
is the opposite of correct.
Also, the return value was flipped.
12 years ago
isaacs
02f017d24f
streams2: Allow 0 as a lowWaterMark value
12 years ago
isaacs
caa853bb06
transform: Automatically read() on _write when read buffer is empty
12 years ago
isaacs
3b59fd70f4
streams2: Make Transform streams pull-style
That is, the transform is triggered by a _read, not by a _write.
This way, backpressure works properly.
12 years ago
isaacs
9b5abe5bfe
streams2: setEncoding and abstract out endReadable
12 years ago
isaacs
51a52c43a2
streams2: Set flowing=true when flowing
12 years ago
isaacs
639fbe28d1
streams2: Convert strings to buffers before passing to _write()
12 years ago
isaacs
420e07c577
streams2: The new stream base classes
12 years ago
isaacs
17834ed28c
Add 'stream' as a native module in repl
12 years ago
isaacs
314c6b3060
Don't allow invalid encodings in StringDecoder class
12 years ago
Ben Noordhuis
d65832ccd0
fs: fix WriteStream fd leak
Close the file descriptor when a write operation fails.
Fixes #4387 .
12 years ago
Ben Noordhuis
6e97b2cc17
fs: fix ReadStream fd leak
Close the file descriptor when a read operation fails.
Fixes #4387 .
12 years ago
Ryunosuke SATO
0506d294dc
events: fix typos in code comment
- newListeners -> newListener
12 years ago
Ryunosuke SATO
eb502205d5
events: setMaxListeners() should not have side effects
This object initialization has been unnecessary since 12cf730b
.
Ref #3803 .
12 years ago
Ryunosuke SATO
1c7acd2c84
events: use assigned variable instead of arguments
Always `arguments[0]` is used when `EventEmitter#emit` called.
Using assigned variable is faster than `arguments[0]`.
12 years ago
Ryunosuke SATO
0397223ab4
events: use null assignment instead of deleting property
12 years ago
Bert Belder
3c293ba272
http: protect against response splitting attacks
12 years ago
isaacs
0e95ea42ce
lint
introduced in 5b65638
.
12 years ago
isaacs
33fa740577
fs: Raise error when null bytes detected in paths
Reworking of @bnoordhuis's more aggressive approach.
12 years ago
Ben Noordhuis
5b65638124
tls, https: add tls handshake timeout
Don't allow connections to stall indefinitely if the SSL/TLS handshake does
not complete.
Adds a new tls.Server and https.Server configuration option, handshakeTimeout.
Fixes #4355 .
12 years ago
Ben Noordhuis
1f76a2eddc
fs: add long stacktrace debugging facility
Enable long stacktraces if NODE_DEBUG=fs is set in the environment. Only
applies to the default rethrow callback; it's to help you find places where
you forgot to pass in a callback.
12 years ago
Ben Noordhuis
a80434736b
fs: fix 'object is not a function' callback errors
Use a default callback if the user omitted one. Avoids errors like the one
below:
fs.js:777
if (err) return callback(err);
^
TypeError: object is not a function
at fs.appendFile (fs.js:777:21)
at Object.oncomplete (fs.js:297:15)
This commit fixes the behavior of fs.lchmod(), fs.lchown() and fs.readFile()
when the callback is omitted. Before, they silently swallowed errors.
Fixes #4352 .
12 years ago
Trevor Norris
6772308883
buffer: Don't double-negate numeric buffer arg
Fix #4331
Using double negate forces values into 32bit space. Because of this
Math.ceil needs to be used. Since NaN comparisons are always false, use
that to our advantage to return 0 if it is.
Also added two tests to verify the changes.
12 years ago
Joshua Erickson
c9f2531ae0
net: More accurate IP address validation and IPv6 dotted notation.
* Added isIP method to make use of inet_pton to cares_wrap.cc
* Modified net.isIP() to make use of new C++ isIP method.
* Added new tests to test-net-isip.js.
This is a back-port of commit fb6377e
from the master branch.
12 years ago
Ben Noordhuis
121ed91331
tls: fix tls.connect() resource leak
The 'secureConnect' event listener was attached with .on(), which blocked it
from getting garbage collected. Use .once() instead.
Fixes #4308 .
12 years ago
Ben Noordhuis
4cb17cb219
net: fix net.connect() resource leak
The 'connect' event listener was attached with .on(), which blocked it from
getting garbage collected. Use .once() instead.
Fixes #4308 .
12 years ago
Scott Blomquist
f657ce685d
windows: add tracing with performance counters
Patch by Henry Rawas and Scott Blomquist.
12 years ago