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

1767 Commits

Author SHA1 Message Date
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
Bert Belder
b866a96cfa test-child-process-kill: make it pass on windows
The test would fail if the child process writes anything to the stdout.
This doesn't happen on unix, since `cat` is spawned. However, on Windows
`cmd` is started, which *does* write stuff to it's stdout. This
meanlingless assert is now removed.
2012-06-12 23:30:57 +02:00
Bert Belder
b53b8b8ae7 test-exec: make it work on Windows 2012-06-12 23:30:54 +02:00
Ben Noordhuis
900196e135 crypto: make cipher/decipher accept buffer args 2012-06-12 21:50:05 +02:00
Bert Belder
cbeeea62cf Revert "uv: upgrade to b7e150ee"
Upgrade wasn't done correctly.
This reverts commit b615077bab.
2012-06-12 19:52:38 +02:00
Bert Belder
b615077bab uv: upgrade to b7e150ee 2012-06-12 17:06:54 +02:00
Bert Belder
517cea3636 test-net-connect-econnrefused: don't take forever to complete 2012-06-12 02:22:30 +02:00
Bert Belder
b27a4cbe2a test-module-loading: convert backslashes to forward slashes
This makes the test pass on Windows.
2012-06-12 02:04:44 +02:00
Bert Belder
094f742657 test-http-get-pipeline-problem: don't fail if there are stray files in the temp dir 2012-06-12 01:56:48 +02:00
Bert Belder
00ba1cbce1 test-net-write-slow: increase the socket timeout period
In Windows the callbacks arrive in slightly different order. A bunch
of write operations complete immediately, and after that there is a
gap of a few hundred ms. This causes the timeout timer to fire, which
is not really warranted; the first few write operations just finished a
little quicker than expected.
2012-06-12 01:43:45 +02:00
isaacs
6ce013dd4b fix fs.readFile with lying size=0 stat results 2012-06-11 15:54:28 -07:00
isaacs
d53cdc5378 Add Buffer.concat method
We write out this loop a lot of places throughout node.
It clearly needs to be an API method.
2012-06-11 15:51:23 -07:00
Charlie McConnell
2eb181d28c child_process: fix test implementation for options.detached 2012-06-11 10:27:51 -07:00
Nuno Job
284816ee9f test: add test for bad unicode sequences
This was a regression in 0.7.9.
2012-06-09 20:30:16 +02:00
isaacs
65242abc3b Fix fs.realpath tests so that they actually run 2012-06-09 09:43:47 -07:00
isaacs
131a67e7ef Fix #3394 fs.realpath: Properly cache symlink targets 2012-06-09 09:43:47 -07:00
Andreas Madsen
60b45dcbb6 domain: document and test dispose event 2012-06-09 18:15:38 +02:00
Andreas Madsen
535e109a3a domain: run now return callback result
both domain.bind and domain.intercept act this way
2012-06-09 18:15:38 +02:00
Marc Harter
569acea0ee Fix #3379 prevent domain.intercept passing 1st arg to cb 2012-06-08 23:32:13 -07:00
Charlie McConnell
4b021a3541 child_process: expose UV_PROCESS_DETACHED as options.detached 2012-06-08 22:57:22 -07:00
Ben Noordhuis
463d6bac8b fs: make callbacks run in global context
Callbacks that were passed to the binding layer ran in the context of the
(internal) binding object. Make sure they run in the global context.

Before:

  fs.symlink('a', 'b', function() {
    console.log(this); // prints "{ oncomplete: [Function] }"
  });

After:

  fs.symlink('a', 'b', function() {
    console.log(this); // prints "{ <global object> }"
  });
2012-06-06 21:49:39 +02:00
isaacs
28e851c169 Warn about running npm in the repl 2012-06-05 12:35:49 -07:00
isaacs
e0f5d8e86d test: v8 stack trace messages changed slightly 2012-06-01 22:31:05 -07:00
Fedor Indutny
af98fc9d5f child_process: new stdio API for .spawn() method 2012-06-01 20:52:13 +04:00
Ben Noordhuis
b337577cf1 test: update pummel/test-exec
ChildProcess.prototype._internal is called ChildProcess.prototype._handle now.
2012-05-31 01:46:56 +02:00
Ben Noordhuis
fa9aa1c961 net: fix 'close' event emit order
The server 'close' event was emitted before the last client 'close' event. Not
exactly fatal but potentially confusing.

Before this commit the order looked something like [client, server, client],
now it looks like [client, client, server].

See #3340 for more details.
2012-05-29 13:05:51 +02:00
Andreas Madsen
1f3e4a76f9 fs: no end emit after createReadStream.pause()
In case a fd option is given to fs.createReadStream a read will instantly
happen. But in the edge case where fd point to an empty file and .pause()
was executed instantly, the end event would emit since no async wait was
between fs.createReadStream and the file read there emits end.
2012-05-27 20:00:19 +02:00
Ben Noordhuis
078763a94c test: update addons .gitignore 2012-05-24 14:07:09 +02:00
Igor Zinkovsky
39e25528eb windows: enable creating directory junctions with fs.symlink 2012-05-24 01:15:15 -07:00
Igor Zinkovsky
6e435da7f9 remove race from test-child-process-fork-exec-argv test 2012-05-22 13:59:40 -07:00
Ben Noordhuis
0888cdd412 test: fix bad comment 2012-05-22 16:14:30 +02:00
Ben Noordhuis
989ae81c71 test: fix simple/test-process-active-wraps
Said test relies a great deal on internals and implementation details (I should
know, I wrote it). Patch it up to work with libuv's new refcounting scheme.
2012-05-22 16:14:30 +02:00
Andreas Madsen
81a4edcf6a cluster: remove NODE_UNIQUE_ID from env on startup
In case a worker would spawn a new subprocess with process.env, NODE_UNIQUE_ID
would have been a part of the env. Making the new subprocess believe it is a
worker, this would result in some confusion if the subprocess where to listen to
a port, since the server handle request would then be relayed to the worker.

This patch removes the NODE_UNIQUE_ID flag from process.env on startup so any
subprocess spawned by a worker is a normal process with no cluster stuff.
2012-05-21 23:27:44 +02:00
Oleg Efimov
968b49ba0a Check for tabs in source line in DisplayExceptionLine
Fix for joyent/node#3280
2012-05-21 18:30:16 +02:00
Ben Noordhuis
ca642b020d test: add http 'data after timeout' test
See #3234. TDB if this is or is not the desired behavior.
2012-05-21 00:31:28 +02:00
isaacs
75670d3f63 test: wait for 'close' event for stdout
At the 'exit' event, it is sometimes not done writing to stdout.
2012-05-20 09:40:10 -03:00
isaacs
d0c010e39b test: root can connect to chmod'd pipes 2012-05-20 09:24:47 -03:00
isaacs
b48f7f7eac test: Solaris is not as granular with rename fs watch events 2012-05-20 00:17:18 -03:00
Andreas Madsen
a039bad299 fs.watch should not require a listener arguments
Since fs.watch returns an event emitter where the change event is exactly
the same as the listener callback, the argument should be required
2012-05-19 18:58:28 -03:00
isaacs
1a2255ab44 Faster fs.readFile and fs.readFileSync 2012-05-16 20:04:44 -07:00
isaacs
9fc7283a40 Fix #3270 Escape url.parse delims
Rather than omitting them.
2012-05-16 15:41:28 -07:00
isaacs
564172510d Revert "test: stack overflow output"
This reverts commit f8519e10b8.

Recent update to V8 fixes the problem where it incorrectly reports the
line number as 0 for thrown RangeErrors.
2012-05-16 14:44:15 -07:00
Adam Malcontenti-Wilson
4099d1eeba http: make http.get() accept a URL
http.get() now accepts either a URL (as a string) or an options object.
2012-05-16 16:43:18 +02:00
Kevin Bowman
dfcdd5b8aa fs: add sync open flags 'rs' and 'rs+' 2012-05-16 00:14:46 +02:00
isaacs
643f00d3f9 Merge branch 'master' into v0.6-merge
Conflicts:
	src/node.cc
2012-05-15 14:21:22 -07:00
Ben Noordhuis
9ae6d8fee3 http: fix client request.end() EPIPE race
request.end() would sometimes try to write a zero-length buffer to the socket.
Don't do that, it triggers an unnecessary EPIPE when the other end has closed
the connection.

Fixes #3257.
2012-05-15 22:05:36 +02:00
isaacs
f8519e10b8 test: stack overflow output 2012-05-15 13:03:56 -07:00
Ben Noordhuis
88d7a10128 test: verify that connect reqs are cleaned up 2012-05-15 21:00:27 +02:00
Ben Noordhuis
5f0406534c process: add _getActiveHandles(), _getActiveRequests()
* process._getActiveHandles() returns a list containing all active handles
  (timers, sockets, etc.) that have not been unref'd.

* process._getActiveRequests() returns a list of active requests (in-flight
  actions like connecting to a remote host, writing data to a socket, etc.).
2012-05-15 21:00:27 +02:00
isaacs
5164ae3838 Merge remote-tracking branch 'ry/v0.6' into v0.6-merge
Conflicts:
	ChangeLog
	deps/uv/include/uv-private/uv-unix.h
	deps/uv/src/unix/core.c
	deps/uv/src/unix/sunos.c
	deps/v8/src/runtime.cc
	doc/api/crypto.markdown
	lib/http.js
	src/node_version.h
	test/gc/test-http-client-timeout.js
	wscript
2012-05-15 11:37:34 -07:00
Ben Noordhuis
4ec77e2e28 child_process: rename field _internal to _handle
Consistent with how other classes that are built around HandleWraps call it.
2012-05-15 16:59:01 +02:00
Ben Noordhuis
9b42d7daaf test: add https + .pfx client/server test 2012-05-14 17:34:33 +02:00
ssuda
fb7348ae06 crypto: add PKCS12/PFX support
Fixes #2845.
2012-05-14 17:12:59 +02:00
Andreas Madsen
dceebbfa31 child_process: allow sending a net Socket and Server object using child.send
child_process.fork() support sending native hander object, this patch add support for sending
net.Server and net.Socket object by converting the object to a native handle object and back
to a useful object again.

Note when sending a Socket there was emitted by a net Server object, the server.connections
property becomes null, because it is no longer possible to known when it is destroyed.
2012-05-14 07:47:52 -07:00
rsolomo
d40415912f net: make isIP() return 0 on empty input 2012-05-14 16:09:04 +02:00
Ben Noordhuis
bd907174e8 node: delete NODE_CHANNEL_FD from env
Prevents accidental inheritance by child processes. If the child process is a
node process, it would try to set up a channel with the parent and consequently
never quit because the channel kept the event loop alive.

Fixes #3240.
2012-05-14 07:19:11 +02:00
Bert Belder
a475e62a3e Windows: add test for path.normalize with UNC paths 2012-05-13 03:29:44 +02:00
koichik
5f9ffa17b1 fs: fix ReadStream.pause() emits duplicate data event
Fixes #3258.
2012-05-12 10:24:46 +09:00
isaacs
9239088e87 500 is a magic number for the GC for some reason 2012-05-11 15:01:38 -07:00
isaacs
a811a4a130 Fix #3058 querystring: Fix incorrect handling of empty keys 2012-05-11 08:49:03 -07:00
Ben Noordhuis
12fc9fa8a7 test: add failing dgram refcount test
Idle UDP sockets (reading nor writing) should not keep the event loop alive.
This will get fixed in v0.8 one way or the other.
2012-05-11 04:39:23 +02:00
Ben Noordhuis
928d28a7b3 util: make _extend() more robust
Add a better 'is object?' check, the old one let values like true slip through.
2012-05-10 16:49:37 +02:00
isaacs
07be9fc3a6 Merge remote-tracking branch 'ry/v0.6' into v0.6-merge
Conflicts:
	Makefile
	lib/zlib.js
	src/node.cc
	src/node.js
2012-05-09 15:12:13 -07:00
Felix Geisendörfer
bf9d8e9214 Fix exception output for module load exceptions
So instead of:

node.js:201
        throw e; // process.nextTick error, or 'error' event on first tick
              ^

You will now see:

path/to/foo.js:1
throw new Error('bar');
      ^

This is a sub-set of isaacs patch here:

https://github.com/joyent/node/issues/3235

The difference is that this patch purely adresses the exception output,
but does not try to make any behavior changes / improvements.
2012-05-09 11:54:43 -07:00
Felix Geisendörfer
814033365b Fix process.nextTick throw call sites
This patch now reports the proper throw call site for exceptions
triggered within process.nextTick. So instead of this:

node.js:201
        throw e; // process.nextTick error, or 'error' event on first tick
              ^

You will now see:

mydir/myscript.js:15
  throw new Error('My Error');
          ^

From my testing this patch causes no performance regressions, but does
greatly simplify processing the nextTickQueue.
2012-05-09 11:54:43 -07:00
Alex Kocharin
e85927119c util: handle non-string return value in .inspect() 2012-05-09 16:44:44 +02:00
Ben Noordhuis
ee437c0557 zlib: fix error reporting
This commit is a back-port of the changes on the master branch.

Fixes #3230.
2012-05-09 04:44:04 +02:00
Bert Belder
0e57aafbb1 Optimize writing strings with Socket.write 2012-05-09 03:56:19 +02:00
Ben Noordhuis
e02af94947 test: add failing HTTP client timeout test
See #3231.
2012-05-07 22:53:32 +02:00
isaacs
3d84c3db25 More cluster event consistency
Regarding discussion in #3198.  Passing the worker as an argument
to an event emitted on the worker is redundant, and an unnecessary
break in consistency vs the events on the ChildProcess objects.

It was removed from 'exit', but 'listening' and others were
overlooked.  This corrects that oversight.
2012-05-05 15:20:10 -07:00
isaacs
1930772693 Move test-fs-largefile into pummel
It's too slow.
2012-05-05 15:05:14 -07:00
koichik
40c4beeb57 string_decoder: added support for UTF-16LE
Fixes #3223.
2012-05-05 22:47:24 +09:00
koichik
ceb51ddaa1 string_decoder: add support for CESU-8
Fixes #3217.
2012-05-05 12:24:01 +09:00
J. Lee Coltrane
a62dd44b20 cluster: worker exit event to match child_process
test: fixes due to new cluster api.

- changed worker `death` to `exit`.
- corrected argument type expected by worker `exit` handler.

test: more tests of cluster.worker death

cluster: fixed arguments on worker 'exit' event

worker 'exit' event now emits arguments consistent with the
corresponding event in child_process module.
2012-05-04 17:28:21 -07:00
isaacs
c1bf810108 Merge branch 'v0.6-merge' 2012-05-04 17:24:30 -07:00