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

1331 Commits

Author SHA1 Message Date
Ben Noordhuis
972cdf82f1 Merge remote-tracking branch 'origin/v0.8'
Conflicts:
	deps/uv/include/uv.h
	src/node_crypto.cc
2012-09-04 15:02:20 +02:00
Ben Noordhuis
19a432260c test: add extra checks in simple/test-cli-eval 2012-09-04 14:41:08 +02:00
Ben Noordhuis
83b1dda12f cli: make argument to -p optional 2012-09-04 14:39:31 +02:00
Ben Noordhuis
7d0543c128 crypto: make pbkdf2() compatible with domains 2012-09-03 23:33:02 +02:00
Ben Noordhuis
d1eff9ab68 crypto: make randomBytes() compatible with domains
Don't execute the callback in the context of the global object.

MakeCallback() tries to apply the active domain to the callback. If the user
polluted the global object with a 'domain' property, as in the code example
below, MakeCallback() will try to apply that.

Example:

    domain = {};                // missing var keyword is intentional
    crypto.randomBytes(8, cb);  // TypeError: undefined is not a function

Fixes #3956.
2012-09-03 23:33:02 +02:00
Ben Noordhuis
f03c3203a1 cli: make -p equivalent to -pe
Fixes #3938.
2012-09-03 16:42:20 +02:00
koichik
7f404e3509 buffer: added support for writing NaN and Infinity
to writeDoubleBE(), writeDoubleLE(), writeFloatBE() and writeFloatLE().
Fixes #3934.
2012-09-02 21:01:43 +09:00
koichik
37f0eb8df3 Revert "buffer: added support for writing NaN and Infinity"
This reverts commit 6b9425fe37.
2012-09-02 20:59:50 +09:00
koichik
6b9425fe37 buffer: added support for writing NaN and Infinity
to writeDoubleBE(), writeDoubleLE(), writeFloatBE() and writeFloatLE().
Fixes #3934.
2012-09-02 00:27:17 +09:00
Shigeki Ohtsu
f347077e78 tls: support unix domain socket/named pipe in tls.connect 2012-08-31 00:23:36 +02:00
Bert Belder
b0d2795fe9 child process: fix processes with IPC channel don't emit 'close'
With this patch the IPC socket is no longer available in the
ChildProcess.stdio array. This shouldn't be very problematic, since
this socket was effectively non-functional; it would never emit any
events.
2012-08-30 16:13:27 +02:00
Ben Noordhuis
8bec26122d tls, https: throw exception on missing key/cert
Throw an exception in the tls.Server constructor when the options object
doesn't contain either a PFX or a key/certificate combo.

Said change exposed a bug in simple/test-tls-junk-closes-server. Addressed.

Fixes #3941.
2012-08-29 22:53:07 +02:00
Bert Belder
143e9bef47 test: make test-fs-truncate pass on windows 2012-08-29 00:16:53 +02:00
Bert Belder
c06e1002c8 windows: make test-child-process-exec-error pass 2012-08-28 21:46:58 +02:00
Bert Belder
bf16d9280e Merge branch 'v0.8'
Conflicts:
	ChangeLog
	deps/openssl/openssl.gyp
	src/node_version.h
2012-08-28 02:54:22 +02:00
isaacs
05282588e0 Buffer.isEncoding(enc)
Re: #3918
2012-08-27 13:01:29 -07:00
Nathan Rajlich
0285dae26a repl: create a new Console instance for the repl when "useGlobal" is off
Now `console.log('blah')` will work in a REPL running over a socket.

Closes #3876.
2012-08-24 14:31:32 -07:00
Nathan Rajlich
025f53c306 console: refactor the console module to be reusable
So that multiple instances can be created pointing
to different writable streams.

This is needed for #3876.
2012-08-24 14:31:32 -07:00
Brian White
c78678b081 http: bubble up parser errors to ClientRequest
Make parser errors bubble up to the ClientRequest instead of the underlying
net.Socket object.

Fixes #3776.
2012-08-24 17:26:31 +02:00
koichik
752ac320ae https: make https.get() accept a URL
https.get() now accepts either a URL (as a string) or an options object.

Refs #2859.
Fixes #3882.
2012-08-24 16:56:06 +02:00
Ben Noordhuis
63d13e86a5 child_process: emit error on exec failure
libuv calls the exit cb with exit code == -1 when it fails to spawn the new
process. Anticipate that and emit the error on the ChildProcess object.
2012-08-21 14:29:20 +02:00
Ben Noordhuis
05b3f88064 test: use common.PORT in simple/test-regress-GH-1697 2012-08-17 14:03:36 +02:00
Ben Noordhuis
916832cd2c test: fix function name typo
It doesn't affect the semantics of the test because it checks if that
particular bit of code throws an exception. It does, only it's a SyntaxError.
2012-08-17 13:45:45 +02:00
Ben Noordhuis
a177f55b0c Merge remote-tracking branch 'origin/v0.8'
Conflicts:
	ChangeLog
	src/node_version.h
	test/message/stdin_messages.out
	tools/install.py
2012-08-17 13:05:20 +02:00
isaacs
22804a9eb8 module: use 'repl' as the filename arg if missing
Fix #3859
2012-08-13 22:07:03 +02:00
isaacs
50c7d80fb0 events: emitter.listeners() should not have side effects
Fixes #3803
2012-08-13 19:04:40 +02:00
Ben Noordhuis
6b18e88b68 tls: handle multiple CN fields when verifying cert
Fixes #3861.
2012-08-12 21:48:26 +02:00
Timothy J Fontaine
320ae691d8 timers: make unref'd timeouts execute in a domain 2012-08-12 01:15:08 +02:00
Timothy J Fontaine
382f22f229 timers: implement setImmediate 2012-08-12 00:07:22 +02:00
Ben Noordhuis
4c150ca0d0 net: fix listen() regression, revert patches
This commit reverts the following commits (in reverse chronological order):

  74d076c errnoException must be done immediately
  ddb02b9 net: support Server.listen(Pipe)
  085a098 cluster: do not use internal server API
  d138875 net: lazy listen on handler

Commit d138875 introduced a backwards incompatible change that broke the
simple/test-net-socket-timeout and simple/test-net-lazy-listen tests - it
defers listening on the target port until the `net.Server` instance has at
least one 'connection' event listener.

The other patches had to be reverted in order to revert d138875.

Fixes #3832.
2012-08-06 23:55:38 +02:00
Josh Erickson
7b367a93ce net: add support for IPv6 addresses ending in ::
Modified net.isIP Ipv6 regex to allow for addresses ending in "::".
Added tests for new IPv6 matching reqex.
2012-08-06 22:25:55 +02:00
isaacs
168a555780 fs: fix naming of truncate/ftruncate functions
For backwards compatibility, fs.truncate(<number>) will proxy to
fs.ftruncate.

Fix #3805
2012-08-06 08:40:56 -07:00
Ben Noordhuis
2f7e0f2da6 fs: remove undocumented .destroy callbacks
The destroy() method of fs.ReadStream and fs.WriteStream takes a callback.
It's a leftover from the node 0.1 days, undocumented and not part of the
streams API. Remove it.
2012-08-06 00:45:32 +02:00
Andreas Madsen
085a09874b cluster: do not use internal server API 2012-08-05 13:53:31 -07:00
Andreas Madsen
d13887512e net: lazy listen on handler
This allow the server to be shared without the need to handle connection
from master
2012-08-04 22:13:07 -07:00
Dominic Tarr
f4a4ef7a2d zlib: Emit 'close' on destroy(). 2012-08-04 13:04:15 -07:00
Tyler Neylon
b48684c6f1 child_process: Fix stdout=null when stdio=['pipe']
Previously, a command with a short stdio array would result in the child's
stdout and stderr objects set to null. For example:

var c = child_process.spawn(cmd, args, {stdio: ['pipe']});
// results in c.stdout === null.

The expected behavior is the above line functioning the same as this one:

var c = child_process.spawn(cmd, args, {stdio: ['pipe', null, null]});
// provides correct (non-null) c.stdout; as does the above, after this fix.
2012-08-04 11:30:58 -07:00
isaacs
3bf1846bb7 Merge remote-tracking branch 'ry/v0.8'
Conflicts:
	ChangeLog
	deps/uv/src/unix/sunos.c
	deps/uv/test/test-tcp-unexpected-read.c
	src/node_version.h
2012-08-03 16:23:14 -07:00
Bert Belder
5fdeebd94d net: make pause work with connecting sockets
This fixes the problem that calling pause() on a socket would not
actually prevent 'data' events from being emitted. It also replaces
the existing test by a more elaborate one.

Ref: #3118
2012-08-03 17:11:08 +02:00
Ben Noordhuis
34c750d7a9 net: fix .listen({fd:0}) 2012-08-02 13:37:02 +02:00
Gil Pedersen
f1fba8d1f5 fs: fix ReadStream / WriteStream missing callback
The (undocumented) callback argument to .destroy() was not called if the
stream was no longer readable / writable.
2012-08-02 01:25:53 +02:00
isaacs
b3cf3f35fc Report errors properly from --eval and stdin 2012-07-30 08:21:39 -07:00
koichik
72bc4dcda4 assert: fix throws() throws an error without message property
Fixes #2893.
2012-07-29 19:48:16 +09:00
Ben Noordhuis
aa0650f444 cluster: fix libuv assert in net.listen()
Problem: calling `server.listen()` (no port) on a net.Server triggered the
following libuv assertion:

  node: ../deps/uv/src/unix/stream.c:406: uv__write: Assertion `fd_to_send >= 0'
  failed.

Cause: uv_tcp_t handles are lazily initialized. Omitting the port made the
handle get initialized even more lazily. Too lazily - it wasn't initialized
when the handle was sent over to the child process.

Solution: implicitly bind to a random port in listen() when the port number
is omitted, it forces the handle to initialize. This is not a change in
behavior, listen() has always been identical to listen(0).

Fixes #3325.
2012-07-29 02:07:16 +02:00
Joe Andaverde
20e12e4be3 events: make .listeners() return a copy
Make EventEmitter.listeners(event) return a copy of the listeners array instead
of the array itself.

Fixes #3442.
2012-07-27 20:28:51 +02:00
Ben Noordhuis
2a30d328fa crypto: add sync interface to crypto.pbkdf2()
Fixes #3766.
2012-07-27 00:02:36 +02:00
Timothy J Fontaine
edd3de8fea test: update dgram tests after API change 2012-07-26 23:55:29 +02:00
Ben Noordhuis
105c6ec8d5 test: suppress simple/test-dgram-pingpong chatter 2012-07-26 23:55:29 +02:00
isaacs
e5498331f4 Merge remote-tracking branch 'ry/v0.8'
Conflicts:
	AUTHORS
	ChangeLog
	src/node_version.h
2012-07-26 11:58:03 -07:00
isaacs
b0c0111b04 https: Use host header as effective servername 2012-07-25 13:38:43 -07:00