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

1999 Commits

Author SHA1 Message Date
isaacs
97db62b4d9 Merge remote-tracking branch 'ry/v0.8' into master
Conflicts:
	AUTHORS
	ChangeLog
	Makefile
	src/node_version.h
2013-01-11 10:18:07 -08:00
Bert Belder
6a91eab097 path: make basename and extname ignore trailing slashes
Fixes #4536
2013-01-11 18:50:09 +01:00
isaacs
3383d77c61 test: child process { stdio:'inherit' } 2013-01-11 09:14:09 -08:00
Bert Belder
7be27240b5 Revert "path: fix bugs related to paths with trailing slashes"
It only does the right thing on unix, and the implementation
isn't great either.

This reverts commit bb1c03989f.
2013-01-11 16:19:21 +01:00
Andreas Madsen
bb1c03989f path: fix bugs related to paths with trailing slashes 2013-01-10 17:58:37 -08:00
isaacs
b43e544140 stream: Use push() for Transform._output()
This also slightly changes the semantics, in that a 'readable'
event may be triggered by the first write() call, even if a
user has not yet called read().

This happens because the Transform _write() handler is calling
read(0) to start the flow of data.  Technically, the new behavior
is more 'correct', since it is more in line with the semantics
of the 'readable' event in other streams.
2013-01-10 13:49:54 -08:00
isaacs
a993f740f0 stream: Add readable.push(chunk) method 2013-01-10 13:49:53 -08:00
Ben Noordhuis
ed825f4888 typed arrays: fix 32 bit size/index overflow
Fix an out-of-bound read/write bug due to integer wrapping. Reported by
Dean McNamee.
2013-01-10 00:55:27 +01:00
Fedor Indutny
45941811dc streams: set listener first, emit 'data' later
When switching into compatibility mode by setting `data` event listener,
`_read()` method will be called immediately. If method implementation
invokes callback in the same tick - all emitted `data` events will be
discarded, because `data` listener wasn't set yet.
2013-01-08 22:13:09 +04:00
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
ad6769fc92 dgram: don't assert on send('string')
Raise a TypeError when the argument to send() or sendto() is anything
but a Buffer.

Fixes the following assertion:

  $ node -e 'require("dgram").createSocket("udp4").send("BAM")'
  node: ../../src/udp_wrap.cc:220: static v8::Handle<v8::Value>
  node::UDPWrap::DoSend(const v8::Arguments&, int): Assertion
  `Buffer::HasInstance(args[0])' failed.
  Aborted (core dumped)

Fixes #4496.
2013-01-08 04:32:40 +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
Brian White
827b2a9b0b http: bubble up parser errors to ClientRequest
Make parser errors bubble up to the ClientRequest instead of the underlying
net.Socket object.

This is a back-port of commit c78678b from the master branch.

Fixes #3776.
2012-12-16 17:25:03 +01: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