Commit Graph

1503 Commits (50cfeef65e60690b6d318a294981aaed4bc98dcc)

Author SHA1 Message Date
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 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