0
0
mirror of https://github.com/nodejs/node.git synced 2024-12-01 16:10:02 +01:00
Commit Graph

1741 Commits

Author SHA1 Message Date
Ben Noordhuis
63c2391984 test: make test-fs-watch-file write to tmp dir
Write temp files to test/tmp, not test/fixtures.
2012-07-09 15:48:43 +02:00
Ben Noordhuis
5b5362aa8d fs: make unwatchFile() remove a specific listener
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.
2012-07-09 15:48:43 +02:00
Nathan Rajlich
d3d83d7b90 process: throw a TypeError when anything but an Array is passed to hrtime()
Fixes #3664.
2012-07-08 20:53:19 -07:00
TJ Holowaychuk
ed7fb149a2 module: add filename to require() json errors
Otherwise it can be quite difficult to figure out which file is busted.

Closes #3580.
2012-07-06 15:26:41 -07:00
Ben Noordhuis
0c47219a72 timers: fix handling of large timeouts
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
2012-07-05 23:07:27 +02:00
Nathan Rajlich
9126dd2d90 repl: fix passing an empty line inserting "undefined" into the buffer
There was a possiblity of insering the string "undefined" into the repl's
command buffer, which would cause interesting results while evaluating.
2012-07-04 11:51:24 -07:00
Maciej Małecki
6a11f3edf4 repl: fix crashes when buffering command
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.
2012-07-04 11:22:10 -07:00
Bert Belder
0cdeb8ed96 windows: make fs.realpath(Sync) work with UNC paths
Closes #3542
2012-06-27 01:59:25 +02:00
isaacs
21aa0df8b2 realpath: No sync cb() calling allowed. 2012-06-26 15:20:26 -07:00
isaacs
5ec056633f Fix #3503: stdin: resume() on pipe(dest) 2012-06-21 16:16:30 -07:00
isaacs
fce7c958ed test: add deprecation fixture 2012-06-21 14:47:25 -07:00
isaacs
5b39929d47 Add --no-deprecation and --trace-deprecation flags 2012-06-21 12:05:33 -07:00
Ben Noordhuis
f0ce98441f fs: make fs.watchFile() work on windows 2012-06-21 03:05:18 +02:00
Ben Noordhuis
d98a8578d6 test: add another fs.watchFile() test 2012-06-21 02:50:13 +02:00
Karl Skomski
57d53a47e8 Use parent SlowBuffer, if any, when Buffer is sliced
Closes #3416
Closes #3477
2012-06-21 01:46:04 +02:00
isaacs
1d3d02c70d Fix fs.readfile('/dev/stdin')
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.
2012-06-20 10:28:44 -07:00
Bert Belder
26b11915b1 test-domain: fix the test to work on Windows
On Windows, full pathnames are stored in the Error object when
a file i/o error happens. This is not the case on Unix. Before
this fix the test would break because of these full paths.
2012-06-20 01:07:57 +02:00
Bert Belder
7a4dfb6aa8 test-cluster-worker-kill: use SIGKILL instead of SIGHUP
In this test sending SIGKILL has the same effect as sending SIGHUP,
but SIGKILL has the advantage that it works on Windows too.
2012-06-20 00:56:33 +02:00
Bert Belder
3795d77113 windows: listen(pipe_name) is not supported when running cluster
- Added a note to the cluster module documentation.
- Disabled test-cluster-http-pipe.
2012-06-20 00:53:01 +02:00
isaacs
de65ba7aba net.Socket: Delay pause/resume until after connect
Fix #3118
2012-06-18 15:17:20 -07:00
Fedor Indutny
0a89e8b838 child_process: add .stdin stream to forks
Remove test as it doesn't make any sense after the latest stdio API
changes.
2012-06-19 01:46:28 +04:00
Bert Belder
30ab1f567d test-eio-limit: bump the number of allowed background tasks to 200
This makes the test pass on Windows.
2012-06-18 15:58:43 +02:00
Bert Belder
1b7d23e81e Fix test-cluster-message so it passes on Windows
The test was relying on a particular order of events that cannot be
guaranteed.

Also fixes some typos.
2012-06-18 15:36:26 +02:00
Ben Noordhuis
ff552ddbaa tls: fix off-by-one error in renegotiation check
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.
2012-06-18 04:31:40 +02:00
Fedor Indutny
ae5b0e1fc1 crypto: add padding to diffie-hellman key
DH_size returns number of bytes in a prime number, DH_compute_key returns number
of bytes in a remainder of exponent, which may have less bytes than a prime
number. Therefore add 0-padding to the allocated buffer.

Fixes #3372
2012-06-18 00:59:31 +04:00
Reid Burke
71a2a2caa6 net: Prevent property access throws during close
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.
2012-06-17 13:00:00 -07:00
isaacs
d614d161c7 test: Don't reuse common.PORT in test-child-process-fork-net
This fixes #3447
2012-06-16 16:26:22 -07:00
Bert Belder
55ef9ef680 Revert "Check if a stream has a valid fd before read_start"
uv_stream_t.fd is a private field which exists only on unix.
This reverts commit 8d5c1201f2.
2012-06-16 20:14:21 +02:00
isaacs
a90bc78534 Revert "DNS: Support NAPTR queries"
This reverts commit 91bf18fcc5.
2012-06-16 11:02:49 -07:00
ssuda
91bf18fcc5 DNS: Support NAPTR queries
Adding support for NAPTR records
fixes #3170
2012-06-16 10:56:49 -07:00
isaacs
e74a733024 Fix #3448 Use listen callback in test-regress-GH-1697 2012-06-16 10:19:34 -07:00
Charlie McConnell
8a068ce849 s/exit/close/ in test-child-process-stdout-flush, fixes #3449 2012-06-16 09:43:04 -07:00
isaacs
bc18bf4ec0 Add test-stdin-pause-resume-sync
This is the last bit needed to Close #3346
2012-06-16 09:05:28 -07:00
Karl Skomski
8d5c1201f2 Check if a stream has a valid fd before read_start
Closes #3118
2012-06-16 09:00:20 -07:00
Charlie McConnell
145612c2f5 test: skip test-http-full-response on ab errors
If we get errors from ab or apr, skip the test and move on.

Fix #3451
2012-06-16 08:38:47 -07:00
Bert Belder
8ccb3cbdba test-domain-implicit-fs: make it pass on windows
The error message is slightly different on windows. However there was no
need to verify the exact error message - there are assert()s that check
all the properties of the error object.
2012-06-15 18:34:27 +02:00
Reid Burke
c9a1b5d162 Fix #3425: removeAllListeners should delete array
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
2012-06-14 17:26:50 -07:00
Bert Belder
13400e3e58 windows: make symlinks tolerant to forward slashes
Closes #3440
2012-06-15 01:37:24 +02:00
isaacs
412c1ab5bc Fix test-fs-realpath on Windows
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.
2012-06-14 16:15:12 -07:00
Andreas Madsen
c2c08196d8 cluster: rename worker.unqiueID to worker.id 2012-06-14 09:32:56 -07:00
isaacs
dd85a8c183 Update message test for new v8 behavior 2012-06-14 08:37:44 -07:00
Bert Belder
34b0b6a613 test-bad-unicode: update to reflect V8 3.11 behavior 2012-06-14 16:06:53 +02:00
Nathan Rajlich
05fe70b582 test: use the debug build of node-weak when necessary 2012-06-13 17:58:28 -07:00
Nathan Rajlich
c752f6c013 test: add a .gitignore file to ignore weak's compiled "build" dir 2012-06-13 17:58:28 -07:00
Nathan Rajlich
6a8b5b36b4 test: bundle node-weak in test/gc so that it doesn't need to be downloaded 2012-06-14 00:56:35 +02:00
Bert Belder
74c8041fb6 test-child-process-spawn-loop: make it pass on Windows.
It wasn't waiting for the child process' stderr to close, so not an
assertion was made *before* all the data that the child process sent
was received by node.
2012-06-13 22:12:30 +02:00
isaacs
e733dc3bc3 Fix #3388 Support listening on file descriptors
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.
2012-06-13 12:24:45 -07:00
isaacs
a11bf99ce0 Fix #3407 os.tmpDir() 2012-06-12 19:08:47 -07:00
Bert Belder
0dba4ad0f9 tests: make all message tests pass on Windows 2012-06-13 03:02:53 +02:00
Bert Belder
5209dad907 test-net-timeout: make it pass on Windows
The test didn't take into account that some time might pass before
libuv makes close callbacks. This is now fixed.
2012-06-13 02:49:33 +02:00