This reverts commit 928ea564d1.
Keeping the original Array instance in-place essentially causes a memory leak
on EventEmitters that use an infinite number of event names (an incrementing
counter, for example), which isn't an unreasonable thing to want to do.
Fixes #3702.
* don't assert when fd isn't an open file descriptor
* don't die with a ReferenceError when fd isn't a file descriptor
you can listen() on
Fixes #3699.
Before this commit, `fs.unwatchFile(path)` removed *all* listeners for `path`.
The function is overloaded now: `fs.unwatchFile(path)` still removes all
listeners, but `fs.unwatchFile(path, cb)` lets you remove a specific listener.
Fixes #3660.
Don't use the double-negate trick to coalesce the timeout argument into a
number, it produces the wrong result for very large timeouts.
Example:
setTimeout(cb, 1e10); // doesn't work, ~~1e10 == 1410065408
Wrong order of operands was causing problems while trying to use command
buffering:
> {
... a: 3,
...
repl.js:284
if (cmd.trim().match(/^npm /) && !self.bufferedCommand) {
^
TypeError: Cannot call method 'trim' of undefined
at finish (repl.js:284:17)
at REPLServer.self.eval (repl.js:118:5)
at rli.on.e (repl.js:260:20)
at REPLServer.self.eval (repl.js:118:5)
at Interface.<anonymous> (repl.js:250:12)
at Interface.EventEmitter.emit (events.js:88:17)
at Interface._onLine (readline.js:183:10)
at Interface._line (readline.js:502:8)
at Interface._ttyWrite (readline.js:720:14)
at ReadStream.<anonymous> (readline.js:105:12)
Test included.
Closes #3515.
Closes #3517.
Closes #3621.
There is no need for fs.readFile() to be using pread rather than read.
The default semantics of read() are such that subsequent reads are where
we want them anyway.
Make CLIENT_RENEG_LIMIT inclusive instead of exclusive, i.e. a limit of 2
means the peer can renegotiate twice, not just once.
Update pummel/test-tls-ci-reneg-attack accordingly and make it less timing
sensitive (and run faster) while we're at it.
Fix #3455.
The remoteAddress and remotePort properties are
dynamically retrieved from _getpeername().
While _getpeername() checks if the _handle is
null, it is also possible for the tcp_wrapped
_handle.getpeername() to return null on error.
Such a condition happens when the remote closes
and one of these properties is accessed before
_handle is set to null.
* V8: Upgrade to v3.11.10
* npm: Upgrade to 1.1.26
* doc: Improve cross-linking in API docs markdown (Ben Kelly)
* Fix #3425: removeAllListeners should delete array (Reid Burke)
* cluster: don't silently drop messages when the write queue gets big (Bert Belder)
* Add Buffer.concat method (isaacs)
* windows: make symlinks tolerant to forward slashes (Bert Belder)
* build: Add node.d and node.1 to installer (isaacs)
* cluster: rename worker.unqiueID to worker.id (Andreas Madsen)
* Windows: Enable ETW events on Windows for existing DTrace probes. (Igor Zinkovsky)
* test: bundle node-weak in test/gc so that it doesn't need to be downloaded (Nathan Rajlich)
* Make many tests pass on Windows (Bert Belder)
* Fix #3388 Support listening on file descriptors (isaacs)
* Fix #3407 Add os.tmpDir() (isaacs)
* Unbreak the snapshotted build on Windows (Bert Belder)
* Clean up child_process.kill throws (Bert Belder)
* crypto: make cipher/decipher accept buffer args (Ben Noordhuis)
When removeAllListeners is called, the listeners array
is deleted to maintain compatibility with v0.6.
Reverts "events: don't delete the listeners array"
This reverts commit 78dc13fbf9.
Conflicts:
test/simple/test-event-emitter-remove-all-listeners.js
Also, in the process, fix a bug in fs.realpath on Windows.
If the user has permission to create symlinks, then use symlinks. If
not, then skip over all the tests that cannot be run using Junctions
instead.
This implements server.listen({ fd: <filedescriptor> }). The fd should
refer to an underlying resource that is already bound and listening, and
causes the new server to also accept connections on it.
Not supported on Windows. Raises ENOTSUP.