Commit Graph

1988 Commits (3f7545442687c8c0968e788e4bd5f4ccd664e247)

Author SHA1 Message Date
Shigeki Ohtsu 9b363b022f net: fix bufferSize include writableStream length
socket.bufferSize missed to include the length of internal buffers in
writableStream.
2013-01-08 04:59:50 +01:00
Ben Noordhuis 879efb3338 test: fix simple/test-http-client-timeout-with-data
The test was failing in debug mode because the timeouts were set too
low. Fix that by increasing the timeouts. Admittedly not a great fix.
If this test keeps playing up, it's probably best to remove it.

Fixes #4528.
2013-01-07 16:04:33 +01:00
Ben Noordhuis 4e1a2f9a89 test: disable simple/test-debug-brk-file
This test is timing sensitive and hence quite unreliable with debug
builds. What's worse is that it leaves a stray child process behind
that listens on the default test port and that makes all the tests
that come after it fail with EADDRINUSE errors.
2013-01-07 03:40:12 +01:00
Bradley Meck 70ad9bbcbd child_process: make fork() execPath configurable
Allows for arbitrary path to executable spawned using `fork`. This
fixes some issues around running multiple versions of node with workers
and allows arbitrary IPC with compatible executables.

Fixes #3248.
2013-01-06 22:55:30 +01:00
James Hight 3f76419a04 net: add localAddress and localPort to Socket 2013-01-05 17:05:13 +01:00
Nirk Niggler 0459a23063 REPL: fix floating point number parsing
In JS, the expression ".1" is a floating point number.  Issue 4268 concerns the
REPL interpreting floating point numbers that lead with a "." as keywords.  The
original bugfix worked for this specific case but not for the general case:

    var x = [
        .1,
        .2,
        .3
    ];

The attached change and test (`.1+.1` should be `.2`) fix the bug.

Closes #4513.
2013-01-03 17:11:54 -08:00
Ben Noordhuis aad2013508 repl: allow overriding builtins
Don't give names of built-in libraries special treatment.
Changes the REPL's behavior from this:

  > var path = 42
  > path
  A different "path" already exists globally

To this:

  > var path = 42
  > path
  42

Fixes #4512.
2013-01-03 19:58:47 +01:00
Fedor Indutny 8a96bb42c6 test: make tests work with newer v8 2013-01-02 12:13:47 +04:00
Ben Noordhuis 9e32c2ef3e dgram: fix double implicit bind error
Calling send() on an unbound socket forces an implicit bind to
a random port.

332fea5 made the 'listening' event asynchronous. Unfortunately,
it also introduced a bug where the implicit bind was tried more
than once if send() was called again before the first bind operation
completed.

Address that by keeping track of the bind status and making sure that
bind() is called only once.

Fixes #4499.
2012-12-31 17:53:00 +01:00
isaacs 6c80ef01c1 node: emit 'exit' when exiting with error
Fix #3555
2012-12-29 16:53:23 -08:00
isaacs ba94f9d6f8 timers: Move list.ontimeout to separate function 2012-12-29 15:32:25 -08:00
lukebayes ae1b0ca7a5 assert: improve support for new execution contexts
More detailed information in GH-693
2012-12-29 11:19:14 -08:00
isaacs 1c2910d94c test-message: Add setTimeout and nextTick message tests 2012-12-29 10:37:31 -08:00
isaacs ec8ebaf300 domain: use camelCase instead of snake_case
While it's true that error objects have a history of getting snake_case
properties attached by the host system, it's a point of confusion to
Node users that comes up a lot.  It's still 'experimental', so best to
change this sooner rather than later.
2012-12-29 10:37:31 -08:00
isaacs 4401bb47bf domain: Do not use uncaughtException handler
This adds a process._fatalException method which is called into from
C++ in order to either emit the 'uncaughtException' method, or emit
'error' on the active domain.

The 'uncaughtException' event is an implementation detail that it would
be nice to deprecate one day, so exposing it as part of the domain
machinery is not ideal.

Fix #4375
2012-12-29 10:37:30 -08:00
Ben Noordhuis 910e24b53d fs: remove fs.sendfile()
Said function has been broken (and useless) since v0.6.0. Remove it altogether.

Fixes #3854.
2012-12-28 18:24:35 +01:00
bentaber e576208eba net: socket.readyState corrections
socket.readyState, .readable, and .writable behavior changed as
a result of the new streaming interfaces. Updated to be backwards
compatible with current API and adds regression test.

closes #4461
2012-12-27 17:53:28 -08:00
Shigeki Ohtsu 8bf0c15a5b stream2: fix to emit end event on http.ClientResponse 2012-12-26 15:20:48 -08:00
Andreas Madsen d68ee22dda stream: do only fake drain when unpiped stream is the source
If the destination had multiply read streams piped to it,
they would all decrease the awaitDrain state and thereby
start the flow
2012-12-26 14:56:02 -08:00
Andreas Madsen 5daa701aba stream: fix event handler leak in readstream pipe and unpipe
After a stream was unpiped there would stil be residual event handlers
2012-12-26 14:56:02 -08:00
Ben Noordhuis d2e7ca0449 test: add regression test for #4463 2012-12-25 22:18:57 +01:00
Nathan Rajlich 837df70b75 repl: don't touch `require.cache`
Fixes #3226.

Consider a production server that uses a REPL to debug. Creating the instance
would wipe out the global cache of modules, and subsequent "require" calls in
the server would be reloaded from disk. The REPL should observe only, without
altering, its environment.
2012-12-21 11:42:40 -08:00
isaacs 244924823e stdio: Do not read from stdout/err
This fixes windows stdio pipes in streams2 land.
2012-12-21 11:05:46 -08:00
isaacs 0edd93dcc1 test: Fix simple/test-http-localaddress 2012-12-21 16:59:20 +00:00
Farid Neshat dcaebec208 fs: add autoClose=true option to fs.createReadStream 2012-12-20 11:25:39 +01:00
isaacs f63af64eb8 test-pummel: Add call validation in net-write-callbacks 2012-12-19 10:55:23 -08:00
isaacs f3f4e290e0 test: 2 resume() calls needed to flush streams 2012-12-19 10:55:23 -08:00
isaacs 82c7c84e25 net: Handle sync writable streams synchronously
This fixes the case where stderr doesn't flush before the process exits.
2012-12-17 15:08:57 -08:00
isaacs 6c5356bfe2 Revert "buffer: allocate memory with mmap()"
Also Revert "buffer: use MAP_ANON, fix OS X build"

This reverts commit ddb15603e7.
This reverts commit 2433ec8276.
2012-12-17 10:47:17 -08:00
isaacs 945f877d30 test: Fix test-https-localaddress*
Fix #4418
2012-12-16 14:40:24 -08:00
Ben Noordhuis 2433ec8276 buffer: allocate memory with mmap()
Work around an issue with the glibc malloc() implementation where memory blocks
are never returned to the operating system when they are allocated with brk()
and have overlapping lifecycles.

Fixes #4283.
2012-12-16 10:19:09 +01:00
isaacs cd51fa8f5a test: Update message tests for streams2 2012-12-14 17:46:24 -08:00
isaacs abbd47e4a3 test: Update simple/test-fs-{write,read}-stream-err for streams2
Streams2 style streams might have already kicked off a read() or write()
before emitting 'data' events.  Make the test less dependent on ordering
of when data events occur.
2012-12-14 17:46:23 -08:00
isaacs 19ecc3a4a6 test updates for streams2 2012-12-14 17:46:23 -08:00
isaacs 0977638ffb test: Fix many tests for http streams2 refactor 2012-12-14 17:46:23 -08:00
isaacs b4df1e62de test updates 2012-12-14 10:52:30 -08:00
isaacs 695abba5ac test: Fix many tests for streams2 net refactor 2012-12-14 10:52:30 -08:00
isaacs f8bb031bdc test: Sync writables may emit finish before callbacks 2012-12-14 10:52:28 -08:00
isaacs 99021b7a4f streams2: pause() should be immediate 2012-12-14 10:52:28 -08:00
isaacs 42981e2aad streams2: Switch to old-mode immediately, not nextTick
This fixes the CONNECT/Upgrade HTTP functionality, which was not getting
sliced properly, because readable wasn't emitted on this tick.

Conflicts:

	test/simple/test-http-connect.js
2012-12-14 10:52:28 -08:00
isaacs e0c600e00e test: Tests for streaming crypto interfaces 2012-12-14 10:52:27 -08:00
isaacs 175f78c6ba crypto: Streaming api for Hmac 2012-12-14 10:52:27 -08:00
isaacs 90de2ddb77 crypto: Streaming interface for Hash 2012-12-14 10:52:26 -08:00
isaacs 3d3a0b3046 test: Writable stream end() method doesn't take a callback 2012-12-14 10:52:26 -08:00
isaacs 70461c39be test: simple/test-file-write-stream needs to use 0 lowWaterMark 2012-12-14 10:52:26 -08:00
isaacs 79fd9620f5 test: Fix test-repl-autolibs inspect call 2012-12-14 10:52:26 -08:00
isaacs 0e01d6398f zlib: streams2 2012-12-14 10:52:26 -08:00
isaacs 44b308b1f7 fs: streams2 2012-12-14 10:52:26 -08:00
isaacs 49ea653363 streams2: Remove pipe if the dest emits error 2012-12-13 17:00:34 -08:00
isaacs 2ff499c022 streams2: Do multipipe without always using forEach
The Array.forEach call is too expensive.
2012-12-13 17:00:32 -08:00