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

1706 Commits

Author SHA1 Message Date
Nathan Rajlich
f41901cdf6 repl: make ^D emit an 'end' event on the readline instance
Also emit 'exit' on the repl when 'end' is emitted on the readline.

Fixes `node debug test/fixtures/breakpoints.js` when ^D is pressed.
2012-03-27 13:54:49 -07:00
Shigeki Ohtsu
e7792e5d46 test: add test of tls.createServer(honorCipherOrder=true) 2012-03-26 05:03:51 -07:00
Shigeki Ohtsu
8727e5f2be test: add test of cleartextStream.getCipher() in tls 2012-03-23 17:09:50 +01:00
Igor Zinkovsky
0dcc43316f don't crash when queued write fails 2012-03-22 17:09:22 -07:00
Bryan Cantrill
d1255914df sunos: fix EMFILE on process.memoryUsage() 2012-03-22 16:18:11 -07:00
Lal Jérémy
ef046bf4f6 test: generate 1024-bit keys, pacify openssl 1.0.1 2012-03-22 23:35:22 +01:00
Nathan Rajlich
feaa8a41c7 cmd: add a -i / --interactive flag to force the REPL
This is the only way to spawn a node child process in REPL mode, and will
also be needed to be able to use the REPL in MinTTY.
2012-03-21 00:05:25 -07:00
isaacs
d2389f8fab debug repl tests: Add visibility, remove test that times out
The 'Can't backtrace now' message takes over 10 seconds to return.
That's too much time to have to wait for a test, and when it times
out, it was causing an orphaned node process.

This cleans up the node process, and also removes the test that's
timing out, so that the case is hit less often.

Todo: Make the backtrace message come back faster.
2012-03-20 19:48:07 -07:00
Erik Lundin
4b1d492561 test: merge typed arrays tests
Merge simple/test-typed-arrays-typenames into simple/test-typed-arrays.
2012-03-21 01:59:40 +01:00
Erik Lundin
f2ebf2469b test: fix simple/test-typed-arrays
* It incorrectly uses assert(a, b) instead of assert.equal(a, b), meaning all
  relevant assertions will pass regardless of whether they're supposed to when
  a == true.

* It makes the assumption that elements in typed arrays for numerical types
  spanning more than one byte, like Uint32Array, are stored little-endian first
  on all machines.

* It contains assorted mistakes like assert(Int32Array, typeof v4) (that one
  only passes thanks to point 1).
2012-03-21 01:59:33 +01:00
Alex Kocharin
415bff26fe repl: fix space autocompletion bug
Tapping <SP> + <TAB> would exit the REPL.
2012-03-20 12:27:59 +01:00
Felix Geisendörfer
18240193ba Expose http parse error codes
Currently http parse errors do not expose the error details available
from http_parser. This patch exposes the error code as `err.code`.
2012-03-19 19:00:16 -07:00
Andreas Madsen
94d337eb0f cluster: kill workers when master dies
This patch will kill the worker once it has lost its connection with the parent.
However if the worker are doing a suicide, other measures will be used.
2012-03-19 14:22:36 -07:00
Andreas Madsen
d927fbc9ab cluster: add graceful disconnect support
This patch add a worker.disconnect() method there will stop the worker from accepting
new connections and then stop the IPC. This allow the worker to die graceful.
When the IPC has been disconnected a 'disconnect' event will emit.

The patch also add a cluster.disconnect() method, this will call worker.disconnect() on
all connected workers. When the workers are disconneted it will then close all server
handlers. This allow the cluster itself to self terminate in a graceful way.
2012-03-19 13:29:01 -07:00
Ben Noordhuis
d8c4ecea0b test: fix race in simple/test-cluster-master-error
Said test checks that the workers shut down when the master errors but it failed
intermittently. Insert a small delay before doing the 'is dead?' check to give
the workers a chance to shut down.
2012-03-19 17:12:52 +01:00
Your Name
fb47a337ba test: changed instances of == to === 2012-03-19 14:24:46 +01:00
koichik
03077db45d test: HTTP responses with no content-length
Refs: #2952.
2012-03-18 00:50:47 +09:00
Nathan Rajlich
11d8823791 process: add process.config
This is the JS representation of the `config.gypi` file that was used when
compiling node. With this information, you can tell whether the current node
binary has shared or static dependencies, or any other configuration options
that may have been used.
2012-03-15 17:15:18 -07:00
Charlie McConnell
c7b8073afc child_process: Separate 'close' event from 'exit'
Currently, a child process does not emit the 'exit' event until 'close' events
have been received on all three of the child's stdio streams.  This change makes
the child object emit 'exit' when the child exits, and a new 'close' event when
all stdio streams are closed.
2012-03-15 17:07:11 -07:00
Nathan Rajlich
928ea564d1 events: don't delete the listeners array in removeListener() 2012-03-15 17:01:29 -07:00
Ben Noordhuis
761a82bc9a test: make .removeAllListeners() test more exhaustive
Also test removal of multiple listeners, it's a separate code path.
2012-03-16 00:25:42 +01:00
Ben Noordhuis
78dc13fbf9 events: don't delete the listeners array
The documentation implies that .removeAllListeners() leaves the listeners array
untouched. Make it so.
2012-03-16 00:20:10 +01:00
Ben Noordhuis
f9aa01de32 test: don't let debugger listen on common.PORT
simple/test-debugger-repl has a tendency to fail and leave behind a stray
process that listens on common.PORT, making later tests fail with EADDRINUSE.
2012-03-16 00:20:10 +01:00
isaacs
702b46c80d Fix invalid timer test
Previously, setTimeout(fn, 0) would create a new Timer() object,
which has a close() method (and is a bit slower).  The recent
change to more closely emulate browser setTimeout behavior dodges
this path, so this assertion is no longer valid.
2012-03-15 14:53:17 -07:00
Ben Noordhuis
7fc835afe3 timers: handle negative or non-numeric timeout values
Follows browser behaviour by scheduling the callback on the next tick.

Fixes #593.
2012-03-15 13:56:30 -07:00
Maciej Małecki
9a35656210 test: test if forks are spawned with parent's process.execArgv 2012-03-15 13:48:06 -07:00
Maciej Małecki
0113f5a72d test: test process.execArgv 2012-03-15 13:48:05 -07:00
Shigeki Ohtsu
d2fba2bf35 test: Fix path to require hello-world module 2012-03-14 11:00:52 -07:00
Łukasz Walukiewicz
677c2c112c Ignore an empty port component when parsing URLs. 2012-03-12 12:46:56 -07:00
isaacs
a10cfba766 module: remove 'exited', replace 'children' array 2012-03-12 10:27:11 -07:00
ssuda
9b672bcaa2 tls: parsing multiple values of a key in ssl certificate
Fixes #2864.
2012-03-10 23:43:16 +09:00
Ben Noordhuis
8c02f9b7c8 buffer: throw from constructor if length > kMaxLength
Throw, don't abort. `new Buffer(0x3fffffff + 1)` used to bring down the process
with the following error message:

  FATAL ERROR: v8::Object::SetIndexedPropertiesToExternalArrayData() length
  exceeds max acceptable value

Fixes #2280.
2012-03-09 23:57:03 +01:00
Ben Noordhuis
296b7a580b cluster: support passing of named pipes
Fixes triggered assertion:

  Assertion failed: (0 && "bad address family"), function GetPeerName,
  file ../src/tcp_wrap.cc, line 237.

Fixes #2870.
2012-03-09 09:42:13 -08:00
Igor Zinkovsky
5ad0140f48 Emit end event only once
fixes #2888

Previously a pair of end events would be emitted if a response was
paused/resumed, and the underlying socket was closed while the
response was paused
2012-03-07 13:37:39 -08:00
ssuda
b72d43cbf9 dgram: fix when we call .close() inside 'listening' 2012-03-06 22:20:23 +01:00
Nathan Rajlich
07c886f944 process: add process.hrtime()
This commit adds a high-resolution timer function.
2012-03-06 20:43:55 +01:00
Dmitry Nizovtsev
1e9bcf26ce net, http, https: add localAddress option
Binds to a local address before making the outgoing connection.
2012-03-06 13:35:49 +01:00
Igor Zinkovsky
9ea5a4c468 fix simple/test-process-argv-0 on windows 2012-03-05 16:51:04 -08:00
Shigeki Ohtsu
59c3923672 process: show detailed error message in process.dlopen() 2012-03-06 01:34:39 +01:00
Igor Zinkovsky
e10bd5177f disable simple/test-signal-handler on Windows 2012-03-05 13:20:13 -08:00
Igor Zinkovsky
61be6844aa disable fs.watchFile tests on windows 2012-03-03 14:35:21 -08:00
ssuda
578ba76e6c util: fix util.format() formatting of %% 2012-03-03 18:22:34 +01:00
Jimb Esser
78db18739a tls: proxy set(Timeout|NoDelay|KeepAlive) methods
- fix crash calling ClientRequest::setKeepAlive if the underlying request is
  HTTPS.
- fix discarding of callback parameter when calling ClientRequest::setTimeout on
  HTTPS requests.
- fix discarding of noDelay parameter when calling ClientRequest::setNoDelay on
  HTTPS requests.
2012-03-03 00:28:43 +01:00
isaacs
d8c5ba2185 Change test fixture from symlink to regular file
The only test using this is test/simple/test-fs-chmod.js, and it was
treating a.js and a1.js as two separate files, resulting in a race
condition.  (Interestingly enough, it was *not* using the symlink file to
test lchmod, which uses a different temp file.)
2012-03-02 09:17:09 -08:00
Igor Zinkovsky
67b10f816c fix test-net-pipe-connect-errors for windows 2012-03-01 14:09:10 -08:00
Vincent Ollivier
8cdbf014bd test: fix typo in test-child-process-stdout-flush 2012-03-01 16:52:46 +01:00
Ben Noordhuis
ebb79cdaba Revert "test-fs-watch: Add faster failure, and link to #2813"
This reverts commit 9a6f936c8a.
2012-02-29 14:26:04 +01:00
koichik
cd5d2473a4 net: fix race write() before and after connect()
Fixes #2827.
2012-02-28 19:57:13 +09:00
koichik
63431796f4 net: fix race write() before and after connect()
Fixes #2827.
2012-02-28 19:27:27 +09:00
isaacs
29463cb60c Update argv0 test to verify correct behavior 2012-02-27 16:41:30 -08:00
AJ ONeal
493a6bb19a [ISSUE #2554 #2567] throw if fs args for 'start' or 'end' are strings 2012-02-27 14:18:51 -08:00
AJ ONeal
7f58d207f3 [ISSUE #2554 #2567] throw if fs args for 'start' or 'end' are strings 2012-02-27 14:17:09 -08:00
Nathan Rajlich
aa35564ca1 Use NODE_MODULE in the hello-world addon example.
Fixes Windows throwing "unknown error" when trying to require the .node file.
2012-02-27 02:44:33 +01:00
Roly Fentanes
db8940dae2 newListener emits correct fn when using once
Fixes #2826.
2012-02-25 15:37:38 +09:00
Maciej Małecki
b73ec84ce1 test: test for process.argv[0] correctness
joyent/node@b0c1541227 introduced a
regression causing `process.argv[0]` to be invalid in node processes
spawned from `PATH` (without explicit path to executable file - for
example when using global node installation).

Instead of finding a correct path to the executable, `process.cwd()`
would be prepended to `process.argv[0]`.
2012-02-23 20:23:24 -08:00
isaacs
9a6f936c8a test-fs-watch: Add faster failure, and link to #2813 2012-02-22 20:57:55 -08:00
isaacs
92cb684e78 Change test fixture from symlink to regular file
The only test using this is test/simple/test-fs-chmod.js, and it was
treating a.js and a1.js as two separate files, resulting in a race
condition.  (Interestingly enough, it was *not* using the symlink file to
test lchmod, which uses a different temp file.)
2012-02-22 20:57:43 -08:00
Ben Noordhuis
defa637378 dgram: fix out-of-bound memory read 2012-02-23 02:07:39 +01:00
isaacs
634b4de2c8 Pause process.stdin in stdin getter
Otherwise, it'll be ref'ed, and keep the process hanging.
2012-02-21 15:31:50 -08:00
isaacs
27d8b059fa Pause process.stdin in stdin getter
Otherwise, it'll be ref'ed, and keep the process hanging.
2012-02-21 15:26:35 -08:00
Ben Noordhuis
b9127eb0a5 buffer: support decoding of URL-safe base64 2012-02-21 15:33:14 +01:00
Tomasz Buchert
c6a04ce78f crypto: add function getDiffieHellman()
Returns a well known, predefined RFC group.
2012-02-21 14:07:25 +01:00
Ben Noordhuis
f116e17a23 test: update HTTP basic auth test
Verify that URL-encoded entities are properly encoded into the Authorization
header.
2012-02-20 17:24:14 +01:00
Ben Noordhuis
86f4846c21 url: decode url entities in auth section
Fixes #2736.
2012-02-20 17:11:21 +01:00
Ben Noordhuis
de5e3f6a6f http: support PURGE request method 2012-02-20 16:12:48 +01:00
Brandon Benvie
b72277183f repl: add automatic loading of built-in libs 2012-02-20 13:56:27 +01:00
Ben Noordhuis
999757983c test: don't let debugger listen on common.PORT
simple/test-debugger-repl-utf8 has a tendency to fail and leave behind a stray
process that listens on common.PORT, making later tests fail with EADDRINUSE.
2012-02-20 13:31:00 +01:00
Ben Noordhuis
7f4aba91d3 test: include common.js in all tests 2012-02-20 13:29:11 +01:00
koichik
7ae0d473a6 test: fix test-tls-over-http-tunnel with v0.7 2012-02-19 11:46:58 -08:00
Mikeal Rogers
d530ee62cd Issue #2762. Add callback to close function. 2012-02-18 17:46:28 -08:00
isaacs
0cdf85e28d Lint all the JavaScripts. 2012-02-18 15:34:57 -08:00
isaacs
31721da4b1 Merge remote-tracking branch 'ry/v0.6' into v0.6-merge
Conflicts:
	AUTHORS
	ChangeLog
	Makefile
	doc/about/index.html
	doc/api/tls.markdown
	doc/community/index.html
	doc/index.html
	doc/logos/index.html
	doc/template.html
	lib/http.js
	lib/tls.js
	src/node_version.h
	src/platform_win32.cc
	test/simple/test-tls-connect-given-socket.js
2012-02-18 09:46:58 -08:00
isaacs
dfed2cef75 Merge branch 'v0.6.11-release' into v0.6 2012-02-17 13:35:52 -08:00
isaacs
a2851b6234 Revert "cluster: propagate bind errors"
This reverts commit 30e462e919.
2012-02-17 12:39:45 -08:00
Fedor Indutny
ae5e23310e repl: remove double calls where possible
Repl is doing double evaluation of code: wrapped in parens and without
them. That's needed to allow users typing multiline chunks of code by
handling syntax errors on repl side. However if function declaration is
wrapped in parens (`(function a() {})`) calling it will be impossible,
so we're evaluating functions twice. That works fine for declaration,
but if entered code chunk returns function - it should not be called
twice.

fix #2773
2012-02-18 00:30:52 +06:00
Nathan Rajlich
a118f21728 repl: make tab completion work on non-objects 2012-02-17 15:51:33 +01:00
Ben Noordhuis
30e462e919 cluster: propagate bind errors
This commit fixes a bug where the cluster module failed to propagate EADDRINUSE
errors.

When a worker starts a (net, http) server, it requests the listen socket from
its master who then creates and binds the socket.

Now, OS X and Windows don't always signal EADDRINUSE from bind() but instead
defer the error until a later syscall. libuv mimics this behaviour to provide
consistent behaviour across platforms but that means the worker could end up
with a socket that is not actually bound to the requested addresss.

That's why the worker now checks if the socket is bound, raising EADDRINUSE if
that's not the case.

Fixes #2721.
2012-02-16 23:47:17 +01:00
einaros
83fd1c1de5 Add WebSocket RFC6455 multiheader fields to the http parser. 2012-02-16 14:12:38 -08:00
Ben Noordhuis
2c07712860 http: allow multiple WWW-Authenticate headers 2012-02-16 14:11:49 -08:00
Ben Noordhuis
3415427dbf tls: mitigate session renegotiation attacks
The TLS protocol allows (and sometimes requires) clients to renegotiate the
session. However, renegotiation requires a disproportional amount of server-side
resources, particularly CPU time, which makes it a potential vector for
denial-of-service attacks.

To mitigate this issue, we keep track of and limit the number of renegotiation
requests over time, emitting an error if the threshold is exceeded.
2012-02-16 18:15:21 +01:00
Mark Nottingham
1e425e3fa7 Generate Date headers on responses when not already present. 2012-02-15 12:35:34 -08:00
Ben Noordhuis
6141386f7e http: allow multiple WWW-Authenticate headers 2012-02-15 17:04:10 +01:00
Igor Zinkovsky
14b20ffc30 add tls-over-http-tunnel test 2012-02-14 11:53:23 -08:00
koichik
b19b8836c3 tls: Allow establishing secure connection on the existing socket 2012-02-14 11:53:05 -08:00
Seth Fitzsimmons
1ce14eca44 dgram: handle close of dgram socket before DNS lookup completes 2012-02-14 14:10:21 +01:00
Fedor Indutny
3f43b1c039 debugger: export debug_port to process
`process.debug_port` is useful for changing debugger port in runtime,
before starting it (via SIGUSR1).

Using `--port=` argument for debugger repl, tests will run debugger
server on a `common.PORT` (as it usually does for any other servers).

`process._debugEnd()` stops debugger and its server.

* debugger: implemented process._debugEnd(), `node debug --port=5858 app.js`
* test: start debugger repl on common.PORT
* fixes #2613
* fixes #2614
2012-02-12 22:27:12 +06:00
Ben Noordhuis
8a6576f764 Merge remote-tracking branch 'origin/v0.6'
Conflicts:
	common.gypi
2012-02-12 16:12:26 +01:00
koichik
2f759a7090 test: fix timing sensitivity in test-net-write-slow 2012-02-12 02:05:30 +09:00
Ben Noordhuis
cacd3ae004 test: add cluster 'bind twice' test
This test starts two clustered HTTP servers on the same port. It expects the
first cluster to succeed and the second cluster to fail with EADDRINUSE.
2012-02-09 06:32:33 +01:00
Ben Noordhuis
81d18398a8 test: add --debug-brk regression test 2012-02-07 23:42:38 +01:00
isaacs
116835561d Merge remote-tracking branch 'ry/v0.6'
Conflicts:
	ChangeLog
	deps/v8/src/version.cc
	deps/v8/tools/gyp/v8.gyp
	doc/about/index.html
	doc/community/index.html
	doc/index.html
	doc/logos/index.html
	doc/template.html
	lib/path.js
	lib/querystring.js
	src/node_version.h
2012-02-06 15:43:21 -08:00
koichik
c2dc673eb5 http: fix http-parser is freed twice
after response to CONNECT/Upgrade request.

Fixes #2704.
2012-02-07 02:29:28 +09:00
Ben Noordhuis
832efb1e01 test: remove deprecated isolates test 2012-02-06 17:47:09 +01:00
Ben Noordhuis
74a8215a86 Revert support for isolates.
It was decided that the performance benefits that isolates offer (faster spin-up
times for worker processes, faster inter-worker communication, possibly a lower
memory footprint) are not actual bottlenecks for most people and do not outweigh
the potential stability issues and intrusive changes to the code base that
first-class support for isolates requires.

Hence, this commit backs out all isolates-related changes.

Good bye, isolates. We hardly knew ye.
2012-02-06 15:44:42 +01:00
koichik
0f0af55a0a net: fix large file downloads failing
Fixes #2678.
2012-02-05 17:41:49 +09:00
Christopher Jeffrey
f64989e63b fs: fix ReadStream fails to read from existing fd
A ReadStream constructed from an existing file descriptor failed to start
reading automatically. Avoids a userspace call to ReadStream.prototype._read().
2012-02-04 22:14:58 +01:00
Stefan Rusu
07a983a602 test: add tcp and https DNS error tests
net-dns-error: specifc test for the net DNS issue.
http-dns-error: now it works for HTTPS as well.
2012-02-04 00:41:24 +01:00
Ben Noordhuis
7e40c7ddc9 buffers: fix intermittent out of bounds error
The base64 decoder would intermittently throw an out-of-bounds exception when
the buffer in `buf.write('', 'base64')` was a zero-sized buffer located at the
end of the slab.

Fixes #2657.
2012-02-02 19:14:06 +01:00
Ben Noordhuis
f101f7c9ba buffers: honor length argument in base64 decoder
Honor the length argument in `buf.write(s, 0, buf.length, 'base64')`. Before
this commit, the length argument was ignored. The decoder would keep writing
until it hit the end of the buffer. Since most buffers in Node are slices of
a parent buffer (the slab), this bug would overwrite the content of adjacent
buffers.

The bug is trivially demonstrated with the following test case:

    var assert = require('assert');
    var a = Buffer(3);
    var b = Buffer('xxx');
    a.write('aaaaaaaa', 'base64');
    assert.equal(b.toString(), 'xxx');

This commit coincidentally also fixes a bug where Buffer._charsWritten was not
updated for zero length buffers.
2012-02-02 19:13:56 +01:00
isaacs
18d179c2d8 Merge remote-tracking branch 'ry/v0.6' into master
Conflicts:
	ChangeLog
	deps/uv/src/unix/udp.c
	deps/uv/src/win/fs.c
	deps/uv/src/win/udp.c
	deps/uv/test/test-fs.c
	doc/index.html
	doc/logos/index.html
	doc/template.html
	src/node_version.h
2012-01-31 18:18:00 -08:00
Dan VerWeire
35b3d15194 test: dgram-{broadcast,multicast}-multi-process : prevent false failures
* check exit code of child processes
* wait 1000 ms to exit the child process
* prefix log messages with [PARENT] or [CHILD] to help debugging
* kill all child processes before exiting

Conflicts:

	test/simple/test-dgram-multicast-multi-process.js
2012-01-31 17:37:38 -08:00
Andreas Madsen
33b7fc250f child_process: do not disconnect on exit emit
When using isolate the .fork would break because it had
no .disconnect method. This remove the exit handler there
would call .disconnect since it was not required.
It also change .disconnect to throw if the channel is closed,
this was not possible before because .disconnect would be called
twice.
2012-01-31 17:22:21 -08:00
Bert Belder
0ad2a9a2e0 Small test-dgram-multicast-multi-process fixes
Somehow windows doesn't want to bind to 224.0.0.1. Let's test with a multicast
address that has no special meaning.
2012-01-31 16:46:14 +01:00
Andreas Madsen
42ea068a1a Test for ChildProcess.disconnect() 2012-01-31 14:47:12 +01:00
Ben Noordhuis
279e7e7341 fs: add O_EXCL support, exclusive open file 2012-01-31 14:29:32 +01:00
Ben Noordhuis
88b919ea56 fs, test: add file open mode tests 2012-01-31 14:29:27 +01:00
Łukasz Walukiewicz
a94ffdaec5 url: Support for IPv6 addresses in URLs.
Fixes #1138, #2610.
2012-01-31 16:58:41 +09:00
koichik
3fd13c6426 http: fix free http-parser too early
when the status code is 100 (Continue).

Fixes #2636.
2012-01-31 00:16:01 +09:00
Ben Noordhuis
b221fe9b29 timers: add v0.4 compatibility hack
If a timer callback throws and the user's uncaughtException handler ignores the
exception, other timers that expire on the current tick should still run.

If #2582 goes through, this hack should be removed.

Fixes #2631.
2012-01-30 14:12:23 +01:00
isaacs
38651521a8 stdout ending test message correction 2012-01-27 13:42:49 -08:00
isaacs
ff0f0aeb40 Fix #2507 Raise errors less agressively when destroying stdio streams
Also, if an error is already provided, then raise the provided
error, rather than throwing it with a less helpful 'stdout cannot
be closed' message.

This is important for properly handling EPIPEs.
2012-01-26 17:55:44 -08:00
Dan VerWeire
a0119af0e4 test: handle unhandled dgram scenarios
- watch for the death of child processes and fail the test if they all die
	- use setTimeout to fail the test if responses are not received and processed in 5000ms
2012-01-26 16:33:56 -08:00
Ben Noordhuis
2775c0e97e dgram: bring back setTTL() 2012-01-24 00:11:45 +01:00
Ben Noordhuis
46e86aa803 dgram: bring back setMulticastLoopback() 2012-01-24 00:11:45 +01:00
Ben Noordhuis
57ddf5f50a test: fix typos in error messages 2012-01-24 00:11:44 +01:00
Ben Noordhuis
aef62a03ee test: join multicast group *after* binding 2012-01-24 00:11:44 +01:00
Ben Noordhuis
9037decb28 test: remove erroneous dropMembership() call
The socket is not part of any multicast group. Bug wasn't visible until 6999fb3.
2012-01-24 00:11:21 +01:00
Fedor Indutny
667aae596c Merge branch 'v0.6'
Conflicts:
	ChangeLog
	doc/template.html
	lib/cluster.js
	lib/http.js
	lib/tls.js
	src/node.h
	src/node_version.h
	test/simple/test-cluster-kill-workers.js
2012-01-24 00:30:28 +06:00
koichik
827180097c test: fix test/simple/test-net-server-max-connections.js is racey
Fixes #1333.
2012-01-22 23:23:04 +09:00
koichik
93298afc4e test: for #2109 2012-01-22 17:35:28 +09:00
koichik
3df7c90c30 http: keep-alive should default with HTTP/1.1 server
As RFC 2616 says we should, assume that servers will provide a persistent
connection by default.

> A significant difference between HTTP/1.1 and earlier versions of
> HTTP is that persistent connections are the default behavior of any
> HTTP connection. That is, unless otherwise indicated, the client
> SHOULD assume that the server will maintain a persistent connection,
> even after error responses from the server.

> HTTP/1.1 applications that do not support persistent connections MUST
> include the "close" connection option in every message.

Fixes #2436.
2012-01-22 14:55:41 +09:00
Maciej Małecki
e10ed097cb path fs: move path.exists* to fs.exists*
`path.exists*` functions show a deprecation warning and call functions
from `fs`. They should be removed later.

test: fix references to `path.exists*` in tests

test fs: add test for `fs.exists` and `fs.existsSync`

doc: reflect moving `path.exists*` to `fs`
2012-01-21 14:37:14 +01:00
Dan VerWeire
f2b1f57f74 dgram: reintroduce setMulticastTTL()
Removed during the early stages of node 0.5 refactoring to libuv.
2012-01-21 03:26:09 +01:00
Dan VerWeire
f749338e1e dgram: reintroduce setBroadcast()
Removed during the early stages of node 0.5 refactoring to libuv.
2012-01-21 03:26:04 +01:00
Roman Shtylman
a38fd6056c dgram: reintroduce addMembership() and dropMembership()
Removed during the early stages of node 0.5 refactoring to libuv.
2012-01-21 03:21:51 +01:00
Igor Zinkovsky
de78922b12 ref isolate loop 2012-01-20 18:03:05 -08:00
koichik
35fe3eb5c7 http: reduce creating http-parser instances
Fixes #2577.
2012-01-20 16:24:01 -08:00
Nicolas LaCasse
40c93486e8 Fix #2365 zlib crashing on invalid input
Fix zlib crashes on error due to improper use of removeListener
in the error handler
2012-01-20 13:12:32 -08:00
Andreas Madsen
f9a47debfc Add cluster.setupMaster
Fixes #2470
2012-01-20 13:09:56 -08:00
Ingmar Runge
0ca30187cf Crypto: adding ability to turn off automatic PKCS padding 2012-01-18 21:20:25 +01:00
Bert Belder
d489a01f81 Make path.extname do the right thing when the last path component is . or ..
Closes GH-2526
2012-01-18 15:21:58 +01:00
Ben Noordhuis
d44ce97909 cluster: don't always kill the master on uncaughtException
uncaughtException handlers installed by the user override the default one that
the cluster module installs, the one that kills off the master process.

Fixes #2556.
2012-01-18 00:45:02 +01:00
Andreas Madsen
4a38795b6f Add failing test case: parent on('exit')
Fixes #2564
2012-01-17 11:43:21 -08:00
Bert Belder
892056bf97 tests: fix more lint issues 2012-01-17 20:16:49 +01:00
Andreas Madsen
4865063924 Tests: fix jslint issues 2012-01-17 19:45:09 +01:00
koichik
534df2f8d2 tls: fix double 'error' events on HTTPS Requests
Fixes #2549.
2012-01-17 17:09:27 +01:00
Ben Noordhuis
549443a7cc typed arrays: set class name
Make obj.toString and Object.prototype.toString work correctly for typed arrays.
2012-01-17 16:20:39 +01:00
Ryan Dahl
ca2a047b8e Merge remote branch 'origin/v0.6'
Conflicts:
	deps/uv/src/win/util.c
	src/udp_wrap.cc
2012-01-16 15:20:26 -08:00
Fedor Indutny
23de33968f querystring: fix maxKeys = 0 is ignored 2012-01-16 16:36:24 +06:00
Fedor Indutny
f1678bfc65 http: do not accept headers if limit is exceeded
* fix limiting when parser was reused
* fix maxHeadersCount = 0 is ignored ( credit to @koichik )
* add test-http-max-headers-count.js ( credit to @koichik )
2012-01-16 16:36:23 +06:00
Fedor Indutny
8a98c2f1d8 http, querystring: added limits to prevent DoS 2012-01-16 02:45:05 +06:00
Fedor Indutny
220288725f test-eio-limit: add missing copyright headers 2012-01-14 23:51:53 +06:00
Fedor Indutny
e03b42d1bb Add failing test-eio-limit.js 2012-01-14 23:48:56 +06:00
Ben Noordhuis
f0c1376e07 net: make .write() throw on bad input
Passing a non-buffer or non-string argument to Socket.prototype.write triggered
an assert:

  Assertion failed: (Buffer::HasInstance(args[0])), function Write,
  file ../src/stream_wrap.cc, line 289.

Fixes #2532.
2012-01-14 02:13:24 +01:00
koichik
7dffbaf2ce http: Upgrade/CONNECT request should detach its socket earlier
With Upgrade or CONNECT request, http.ClientRequest emits 'close' event
after its socket is closed. However, after receiving a response, the socket
is not under management by the request.

http.ClientRequest should detach the socket before 'upgrade'/'connect'
event is emitted to pass the socket to a user. After that, it should
emit 'close' event immediately without waiting for closing of the socket.

Fixes #2510.
2012-01-12 14:17:19 +09:00
Fedor Indutny
71ae175319 zlib: reset() method for deflate/inflate streams
* ammended test-zlib-dictionary to cover reusing streams
2012-01-12 03:19:19 +06:00
Andreas Madsen
c8108aad83 child_process: fix typo in internal message event name 2012-01-11 09:59:50 +01:00
Ryan Dahl
e1b829d2a5 Add broken test-isolates3.js 2012-01-10 12:04:19 -08:00
Ryan Dahl
d4ee61ffc7 Add failing test-isolates2.js 2012-01-10 11:48:02 -08:00
Fedor Indutny
4cbcdb4b2c test: make debugger-repl tests work with isolates 2012-01-10 16:48:45 +01:00
Fedor Indutny
99679c6430 IsolateDebugger C++ 2012-01-10 02:28:42 +01:00
Ben Noordhuis
97e4b3a7bf isolates: drain message queue completely 2012-01-10 02:09:08 +01:00
Andreas Madsen
787f62de8c Improve test-child-process-silent 2012-01-09 13:04:13 -08:00
Ryan Dahl
8b28d599a7 Merge remote branch 'origin/v0.6'
Conflicts:
	Makefile
	configure
	src/node_version.h
2012-01-09 11:20:22 -08:00
Ryunosuke SATO
22d7fe1206 events: fix checking max listeners with 1
Fixes #2490.
2012-01-09 04:02:01 +01:00
koichik
08a91acd76 http: better support for CONNECT method.
Introduces 'connect' event on both client (http.ClientRequest) and
server (http.Server).

Refs: #2259, #2474.
Fixes #1576.
2012-01-09 03:51:06 +01:00
koichik
c1a63a9e90 tls: Allow establishing secure connection on the existing socket
This is necessary to use SSL over HTTP tunnels.

Refs #2259, #2474.
Fixes #2489.
2012-01-09 02:31:46 +01:00
koichik
70033bd960 net: make connect() accept options
This makes API even with tls.connect().
Refs #1983.

See also:
http://groups.google.com/group/nodejs-dev/msg/3b6dbcc4a9a82d99

Fixes #2487.
2012-01-09 02:18:39 +01:00
Maciej Małecki
39484f49ef test tls: make tests use new tls.connect API
Refs #1983.
2012-01-08 11:13:28 +01:00
Ryan Dahl
8bd80f4911 fix test-sys for hash randomization
broken in 4a899c9274
2012-01-06 10:22:24 -08:00
koichik
dd9593ccc4 http: fix ServerResponse does not emit 'close'
Refs #2453.
2012-01-06 15:45:21 +09:00
Ben Noordhuis
dadc30318f isolates: implement message passing
Parent and child isolates can now pass arbitrary binary messages between each
other. The messages are sent and received through a thread-safe queue that
wakes up the event loop of the receiving thread.
2012-01-06 00:42:55 +01:00
Emerson Macedo
aa67b1f375 fs: add appendFile() and appendFileSync() functions 2012-01-05 21:39:57 +01:00
Mikael Bourges-Sevenier
5b05429bf0 typed arrays: add Buffer -> TypedArray constructor
- create a typed array from a node::Buffer object
- update TypedArray::set() to spec
- add TypedArray::get() method
2012-01-05 20:56:41 +01:00
Andreas Madsen
5f08c3cfa1 cluster improvements: Worker class and isolate internal messages
Fixes #2388
2012-01-04 18:30:19 -08:00
Ryan Dahl
f3da6c6c04 Potential fix for #2438
- Save StringPtr if the header hasn't been completely received yet after one
  packet.
- Add one to num_fields and num_values. They were actually one less than the
  number of fields and values.
- Remove always_inline makes debugging difficult, and has negligible
  performance benefits.
2012-01-03 17:43:39 -08:00
Ryan Dahl
2cde498319 Add another test to test-http-parser-bad-ref.js demoing #2438 2012-01-03 17:15:25 -08:00
Ben Noordhuis
c123ac05dc Merge remote-tracking branch 'origin/v0.6'
Conflicts:
	src/udp_wrap.cc
2012-01-02 12:29:39 +01:00
Ben Noordhuis
884f689efe test: add #2293 regression test
Creating a file event watcher with fs.watch({persistent:false}) should not block
the event loop.
2012-01-02 10:48:35 +01:00
Ben Noordhuis
539598b11f test: don't create temp files in fixtures dir 2011-12-31 03:17:19 +01:00
Ryan Dahl
432a2e4d39 Add test for #2438
Unfortunately valgrind must be used to see the bad read. It would be nice if
we could improve this test to cause a segfault.
2011-12-29 13:37:03 -08:00
Ben Noordhuis
c24276f008 net: defer net.Server 'close' event to next tick 2011-12-29 19:30:07 +01:00
Ryan Dahl
4428b70cba Add isolate version of test-child-process-fork 2011-12-29 01:56:11 +01:00
Ryan Dahl
5fc0c27d5c move isolate V8 functions out of node.cc 2011-12-29 01:56:11 +01:00
Ryan Dahl
40c98a977b Add shared-buffer isolate addon test 2011-12-29 01:56:11 +01:00
Ryan Dahl
2c560c5405 Change isolate test to demo EIO bug 2011-12-29 01:56:10 +01:00
Ryan Dahl
a0f3eb015a node_file.cc should use NODE_LOOP() 2011-12-29 01:56:10 +01:00
Ryan Dahl
268476549e Join all threads at end of main thread
Require reorganizing the isolates somewhat.

Add a very simple test.
2011-12-29 01:56:10 +01:00
Ben Noordhuis
bc7bae1d6b Merge remote-tracking branch 'origin/v0.6'
Conflicts:
	src/platform_win32.cc
2011-12-29 01:49:10 +01:00
Andreas Madsen
d483acc5d9 test: remove internet test from test/simple/ 2011-12-28 17:22:29 +01:00
koichik
b037c16f55 test: fix test-sys.js fails if the time zone is not CET
Fixes #2423.
2011-12-28 15:18:11 +09:00
koichik
a848a3efbf net: fix Socket.pause null reference when called on a closed Stream
Fixes #1980.
2011-12-28 15:13:57 +09:00
koichik
a337ac7584 http: fix XMLHttpRequest piped in a writable file stream hangs next request
Fixes #2263.
2011-12-27 17:42:37 +09:00
koichik
e6b6075024 http: Avoid 'data'/'end' events after pause()
Fixes #1040.
2011-12-26 16:14:47 +01:00
koichik
7aa5924dc6 http: fix resource leak
Fixes #2069
2011-12-26 08:05:35 +01:00
Ryan Dahl
c2d9e62f16 Merge remote branch 'origin/v0.6'
Conflicts:
	deps/v8/src/version.cc
2011-12-23 15:58:11 -08:00
Ben Noordhuis
b261e37a34 test: ensure callback is executed 2011-12-22 17:28:23 +01:00
Ju-yeong Park
5976d58796 net: raise exception when the socket is closed 2011-12-22 17:25:14 +01:00
Ryan Dahl
6ac22bfb04 Add gitignore file for addon tests 2011-12-21 14:18:56 -08:00
Ryan Dahl
f7f8af8420 Merge remote branch 'origin/v0.6'
Conflicts:
	Makefile
	lib/_debugger.js
2011-12-21 12:17:23 -08:00
koichik
07c27e040e tls: Fix node swallows openssl error on request
Fixes #2308.
Fixes #2246.
2011-12-21 19:48:15 +01:00
Ryan Dahl
18b92201be Support addons with gyp
Initial pass.
2011-12-20 22:03:35 -08:00
James Hartig
348d8cd04a timers: remove _idleTimeout from item in .unenroll()
Stops .active() from reactivating the timer.

Fixes #2114.
2011-12-20 00:57:15 +01:00
jbergstroem
f9994114ab build: remove unused cmakelist 2011-12-20 00:10:49 +01:00
Maciej Małecki
5c7532e5b3 assert: test RegExp's properties when checking for equality
Previous code ignored the fact that `/a/ != /a/g`.

Test case included.
2011-12-20 00:10:49 +01:00
Pedro Teixeira
a805012d6f assert: .deepEqual() support for RegExp objects 2011-12-20 00:10:38 +01:00
Andreas Madsen
07b1997388 Add env argument to cluster.fork
Fixes 2378
2011-12-19 12:34:59 -08:00
Nathan Rajlich
855f46677c test: Add test case for MODULE_NOT_FOUND. 2011-12-19 23:47:07 +09:00
Avi Flax
ee0a7b928b util: output Dates with Date.toString not Date.toUTCString 2011-12-18 23:07:47 +01:00
Felix Geisendörfer
ec51bfc995 Use common.PORT to avoid conflicts 2011-12-18 16:00:55 +01:00