platform/upstream/nodejs.git
11 years agogitignore: Ignore release tarballs and shasum files
isaacs [Fri, 1 Feb 2013 18:17:22 +0000 (10:17 -0800)]
gitignore: Ignore release tarballs and shasum files

11 years agodns, cares: don't filter NOTIMP, REFUSED, SERVFAIL
Ben Noordhuis [Fri, 1 Feb 2013 16:33:19 +0000 (17:33 +0100)]
dns, cares: don't filter NOTIMP, REFUSED, SERVFAIL

Report the aforementioned DNS server failure codes as-is, stop c-ares
from reporting them as ARES_ECONNREFUSED.

Reported by Steve Freegard.

11 years agostream: Don't stop reading on zero-length decoded output
isaacs [Thu, 31 Jan 2013 21:33:37 +0000 (13:33 -0800)]
stream: Don't stop reading on zero-length decoded output

Fixes regression introduced in 7e1cf84c9efd491d72b25968a70656458ecb6b7c

11 years agostream: Don't signal EOF on '' or Buffer(0)
isaacs [Thu, 31 Jan 2013 19:22:07 +0000 (11:22 -0800)]
stream: Don't signal EOF on '' or Buffer(0)

Those values, if passed to the _read() cb, will not signal an EOF.  Only
null or undefined will mark the end of data, and trigger the end event.

However, great care must be taken if you are returning an empty string
or buffer!  There must be some other thing somewhere that will trigger
a read() call, because there will never be a readable event fired later.

This is in preparation for CryptoStreams being ported to streams2, where
it is safe to simply stop reading, because the crypto cycle process will
cause it to read(0) again at some future date.

11 years agonode: Do not use fn.apply() in process._makeCallback
isaacs [Wed, 30 Jan 2013 07:23:36 +0000 (23:23 -0800)]
node: Do not use fn.apply() in process._makeCallback

11 years agolint
isaacs [Wed, 30 Jan 2013 07:55:58 +0000 (23:55 -0800)]
lint

11 years agoos: rename tmpDir() to tmpdir() for consistency
Ben Noordhuis [Tue, 29 Jan 2013 16:27:33 +0000 (17:27 +0100)]
os: rename tmpDir() to tmpdir() for consistency

Make the casing consistent with the other os.* functions but keep
os.tmpDir() around as an alias.

11 years agoreadline: treat bare \r as a line ending
isaacs [Wed, 30 Jan 2013 01:50:44 +0000 (17:50 -0800)]
readline: treat bare \r as a line ending

Fixes #3305

11 years agoreadline: make \r\n emit one 'line' event
Ben Noordhuis [Mon, 28 Jan 2013 12:13:28 +0000 (13:13 +0100)]
readline: make \r\n emit one 'line' event

Make lines ending \r\n emit one 'line' event, not two (where the second
one is an empty string).

This adds a new keypress name: 'return' (as in: 'carriage return').

Fixes #3305.

11 years agoRevert "net: Avoid tickDepth warnings on small writes"
isaacs [Tue, 29 Jan 2013 01:15:22 +0000 (17:15 -0800)]
Revert "net: Avoid tickDepth warnings on small writes"

This commit breaks simple/test-stream2-stderr-sync.  Need to figure out
a better way, or just accept that `(function W(){stream.write(b,W)})()`
is going to be noisy.  People should really be using the `'drain'` event
for this use-case anyway.

This reverts commit 02f7d1bfd8b5b75620352774967dce63b0934037.

11 years agonet: Avoid tickDepth warnings on small writes
isaacs [Mon, 28 Jan 2013 19:15:53 +0000 (11:15 -0800)]
net: Avoid tickDepth warnings on small writes

Always defer the _write callback.  The optimization here was only
relevant in some oddball edge cases that we don't actually care about.

Our benchmarks confirm that just always deferring the Socket._write cb
is perfectly fine to do, and in some cases, even slightly more
performant.

11 years agodgram: avoid EventEmitter leak warning
Bert Belder [Mon, 28 Jan 2013 21:19:02 +0000 (22:19 +0100)]
dgram: avoid EventEmitter leak warning

When a datagram socket hasn't been bound yet, node will defer `send()`
operations until binding has completed. Before this patch a `listening`
listener would be installed every time `send` was called. This triggered
an EventEmitter leak warning when more than 10 packets were sent in a
tight loop. Therefore switch to using a single `listening` listener, and
use an array to enqueue outbound packets.

11 years agocluster: support datagram sockets
Bert Belder [Tue, 22 Jan 2013 22:52:20 +0000 (23:52 +0100)]
cluster: support datagram sockets

11 years agochild_process: move binding init in constructor
Fedor Indutny [Mon, 28 Jan 2013 17:22:59 +0000 (21:22 +0400)]
child_process: move binding init in constructor

Doing this in net.Socket constructor has much more overhead, and
error is actually may happen before the construction of socket object.

11 years agonet: Initialize _connection, _handle in Socket ctor
isaacs [Mon, 28 Jan 2013 16:54:27 +0000 (08:54 -0800)]
net: Initialize _connection, _handle in Socket ctor

The better to reduce the hidden classes

11 years agohttp: Don't dump twice
isaacs [Mon, 28 Jan 2013 16:54:08 +0000 (08:54 -0800)]
http: Don't dump twice

11 years agostream: Correct Transform class backpressure
isaacs [Sun, 27 Jan 2013 19:56:36 +0000 (11:56 -0800)]
stream: Correct Transform class backpressure

The refactor in b43e544140ccf68580c02e71c56d19b82e1e1d32 to use
stream.push() in Transform inadvertently caused it to immediately
consume all the written data, regardless of whether or not the readable
side was being consumed.

Only pull data through the _transform() process when the readable side
is being consumed.

Fix #4667

11 years agonet: initialize TCPWrap when receiving socket
Fedor Indutny [Mon, 28 Jan 2013 09:04:58 +0000 (13:04 +0400)]
net: initialize TCPWrap when receiving socket

TCPWrap::Initialize() and PipeWrap::Initialize() should be called before
any data will be read from received socket. But, because of lazy
initialization of these bindings, Initialize() method isn't called.

Init bindings manually upon socket receiving.

See #4669

11 years agotest: move simple/test-http-dns-fail to test/internet
Ben Noordhuis [Mon, 28 Jan 2013 11:41:54 +0000 (12:41 +0100)]
test: move simple/test-http-dns-fail to test/internet

The test times out when the upstream DNS resolver takes too long to
respond.

See #4672.

11 years agotest: fix pummel test out-of-memory errors
Ben Noordhuis [Sun, 27 Jan 2013 21:01:10 +0000 (22:01 +0100)]
test: fix pummel test out-of-memory errors

Fix the following OOM error in pummel/test-net-connect-memleak
and pummel/test-tls-connect-memleak:

  FATAL ERROR: CALL_AND_RETRY_0 Allocation failed - process out of
  memory

Commit v8/v8@91afd39 increases the size of the deoptimization table
to the extent that a 64M float array pushes it over the brink. Switch
to SMIs so it stays below the limit.

pummel/test-net-connect-memleak is still failing albeit with a different
error this time. Needs further investigation.

  === release test-net-connect-memleak ===
  Path: pummel/test-net-connect-memleak
  -64 kB reclaimed
  assert.js:102
    throw new assert.AssertionError({
          ^
  AssertionError: false == true
      at done [as _onTimeout] (/home/bnoordhuis/src/nodejs/master/
  test/pummel/test-net-connect-memleak.js:48:3)
      at Timer.listOnTimeout [as ontimeout] (timers.js:110:15)
      at process._makeCallback (node.js:306:20)

11 years agobuffer: fix Buffer::Copy regression from 00b4b7b
Ben Noordhuis [Sun, 27 Jan 2013 20:50:00 +0000 (21:50 +0100)]
buffer: fix Buffer::Copy regression from 00b4b7b

If the end argument is omitted or not a number, make it default to
the end of the buffer, not zero.

Ideally, it should not matter what it defaults to because the JS shim
in lib/buffer.js should handle that but there are still several places
in node.js core that secrete SlowBuffers, hence Buffer::Copy() gets
called without going through Buffer.prototype.copy() first.

11 years agostream_wrap: reference handle before uv_write2
Fedor Indutny [Sun, 27 Jan 2013 15:25:54 +0000 (19:25 +0400)]
stream_wrap: reference handle before uv_write2

Revert commit 7f2a78bf4d494806ccabcccdeb8579dcc4405a8d and fix using
empty symbol handle.

11 years agoRevert "stream_wrap: reference handle before uv_write2"
Ben Noordhuis [Sun, 27 Jan 2013 14:21:03 +0000 (15:21 +0100)]
Revert "stream_wrap: reference handle before uv_write2"

It's segfaulting in release mode and asserting in debug mode:

  #
  # Fatal error in ../../deps/v8/src/api.h, line 297
  # CHECK(allow_empty_handle || that != __null) failed
  #

This reverts commit 99f0b022d528cc350f87150b5ecdf5c903aaeeb1.

11 years agostream_wrap: reference handle before uv_write2
Fedor Indutny [Fri, 25 Jan 2013 12:34:54 +0000 (16:34 +0400)]
stream_wrap: reference handle before uv_write2

Before sending handle to another process using uv_write2(), it should be
referenced to prevent it from being GCed before AfterWrite() will be
called.

see #4599

11 years agodoc: fix line wrapping in addons.markdown
isaacs [Fri, 25 Jan 2013 22:27:46 +0000 (14:27 -0800)]
doc: fix line wrapping in addons.markdown

11 years agodoc: NODE_MODULE() to pass full `module` to addons
Rod Vagg [Mon, 21 Jan 2013 03:20:43 +0000 (14:20 +1100)]
doc: NODE_MODULE() to pass full `module` to addons

mainly to allow native addons to export single functions on `exports`
rather than being restricted to operating on an existing `exports`
object.

added link to addons repo in docs

11 years agoaddon: Pass module object to NODE_MODULE init function
isaacs [Thu, 24 Jan 2013 23:40:58 +0000 (15:40 -0800)]
addon: Pass module object to NODE_MODULE init function

mainly to allow native addons to export single functions on
rather than being restricted to operating on an existing
object.

Init functions now receive exports as the first argument, like
before, but also the module object as the second argument, if they
support it.

Related to #4634

cc: @rvagg

11 years agobuffer: remove minor Buffer::Copy deoptimizations
Ben Noordhuis [Fri, 25 Jan 2013 21:03:11 +0000 (22:03 +0100)]
buffer: remove minor Buffer::Copy deoptimizations

* Omit ToObject() call. Buffer::Data() and Buffer::Length() know how
  to deal with Values.

* Don't check if the argument is undefined because it realistically
  never is and undefined->integer coercion achieves the same thing.

11 years agobuffer: error and misc cleanup
Trevor Norris [Tue, 22 Jan 2013 19:10:11 +0000 (11:10 -0800)]
buffer: error and misc cleanup

Changed types of errors thrown to be more indicative of what the error
represents. Also removed a few unnecessary uses of the v8 fully
quantified typename.

11 years agobuffer: clean up copy() asserts and tests
Trevor Norris [Tue, 22 Jan 2013 18:48:54 +0000 (10:48 -0800)]
buffer: clean up copy() asserts and tests

Argument checks were simplified by setting all undefined/NaN or out of
bounds values equal to their defaults.

Also copy() tests had a flaw that each buffer had the same bit pattern at
the same offset. So even if the copy failed, the bit-by-bit comparison
would have still been true. This was fixed by filling each buffer with a
unique value before copy operations.

11 years agobuffer: slow buffer copy compatibility fix
Trevor Norris [Tue, 22 Jan 2013 17:09:12 +0000 (09:09 -0800)]
buffer: slow buffer copy compatibility fix

Fix issue where SlowBuffers couldn't be passed as target to Buffer
copy().

Also included checks to see if Argument parameters are defined before
assigning their values. This offered ~3x's performance gain.

11 years agodoc: Connecting debugger to existing node process
Sugendran Ganess [Thu, 6 Dec 2012 00:01:41 +0000 (11:01 +1100)]
doc: Connecting debugger to existing node process

11 years agoAdd bytesWritten to tls.CryptoStream
Andy Burke [Wed, 23 Jan 2013 23:17:04 +0000 (15:17 -0800)]
Add bytesWritten to tls.CryptoStream

This adds a proxy for bytesWritten to the tls.CryptoStream.  This
change makes the connection object more similar between HTTP and
HTTPS requests in an effort to avoid confusion.

See issue #4650 for more background information.

11 years agoNow working on v0.9.9
isaacs [Thu, 24 Jan 2013 18:31:40 +0000 (10:31 -0800)]
Now working on v0.9.9

11 years agoMerge branch 'v0.9.8-release'
isaacs [Thu, 24 Jan 2013 18:31:23 +0000 (10:31 -0800)]
Merge branch 'v0.9.8-release'

11 years agotest: Add transform objectMode test
isaacs [Thu, 24 Jan 2013 18:12:19 +0000 (10:12 -0800)]
test: Add transform objectMode test

11 years ago2013.01.24, Version 0.9.8 (Unstable) v0.9.8
isaacs [Thu, 24 Jan 2013 17:15:25 +0000 (09:15 -0800)]
2013.01.24, Version 0.9.8 (Unstable)

* npm: Upgrade to v1.2.3

* V8: Upgrade to 3.15.11.10

* streams: Support objects other than Buffers (Jake Verbaten)

* buffer: remove float write range checks (Trevor Norris)

* http: close connection on 304/204 responses with chunked encoding (Ben Noordhuis)

* build: fix build with dtrace support on FreeBSD (Fedor Indutny)

* console: Support formatting options in trace() (isaacs)

* domain: empty stack on all exceptions (Dave Olszewski)

* unix, windows: make uv_*_bind() error codes consistent (Andrius Bentkus)

* linux: add futimes() fallback (Ben Noordhuis)

11 years agonpm: Upgrade to v1.2.3
isaacs [Thu, 24 Jan 2013 17:06:31 +0000 (09:06 -0800)]
npm: Upgrade to v1.2.3

11 years agoV8: Reapply floating patches
isaacs [Thu, 24 Jan 2013 17:02:21 +0000 (09:02 -0800)]
V8: Reapply floating patches

11 years agoV8: Upgrade to 3.15.11.10
isaacs [Thu, 24 Jan 2013 16:59:39 +0000 (08:59 -0800)]
V8: Upgrade to 3.15.11.10

11 years agotls: make slab buffer's size configurable
Fedor Indutny [Tue, 22 Jan 2013 13:27:05 +0000 (17:27 +0400)]
tls: make slab buffer's size configurable

see #4636

11 years agotest: Add test for negative stream drain counter
isaacs [Thu, 24 Jan 2013 03:15:03 +0000 (19:15 -0800)]
test: Add test for negative stream drain counter

11 years agostreams2: Handle sync read callbacks nicely
isaacs [Thu, 24 Jan 2013 01:52:45 +0000 (17:52 -0800)]
streams2: Handle sync read callbacks nicely

11 years agostreams: Support objects other than Buffers
Raynos [Sat, 12 Jan 2013 04:59:57 +0000 (20:59 -0800)]
streams: Support objects other than Buffers

We detect for non-string and non-buffer values in onread and
turn the stream into an "objectMode" stream.

If we are in "objectMode" mode then howMuchToRead will
always return 1, state.length will always have 1 appended
to it when there is a new item and fromList always takes
the first value from the list.

This means that for object streams, the n in read(n) is
ignored and read() will always return a single value

Fixed a bug with unpipe where the pipe would break because
the flowing state was not reset to false.

Fixed a bug with sync cb(null, null) in _read which would
forget to end the readable stream

11 years agogitignore: ignore v8.log files
Ben Noordhuis [Thu, 24 Jan 2013 10:35:29 +0000 (11:35 +0100)]
gitignore: ignore v8.log files

11 years agohttp: close connection on 204 and chunked encoding
Ben Noordhuis [Wed, 23 Jan 2013 12:47:29 +0000 (13:47 +0100)]
http: close connection on 204 and chunked encoding

This is similar to commit 2cbf458 but this time for 204 No Content
instead of 304 Not Modified responses.

When the user sends a 204 response with a Transfer-Encoding: chunked
header, suppress sending the zero chunk and force the connection to
close.

11 years agobuild: Add some gyp artifacts to .gitignore
Scott Blomquist [Thu, 17 Jan 2013 06:29:48 +0000 (22:29 -0800)]
build: Add some gyp artifacts to .gitignore

11 years agobuffer: remove float write range checks
Trevor Norris [Tue, 22 Jan 2013 22:35:20 +0000 (14:35 -0800)]
buffer: remove float write range checks

Removed range checks when writing float values, and removed a few
includes and defines. Also updated api docs to reflect that invalid 32
bit float is an unspecified behavior.

11 years agohttp: close connection on 304 and chunked encoding
Ben Noordhuis [Wed, 23 Jan 2013 00:42:16 +0000 (01:42 +0100)]
http: close connection on 304 and chunked encoding

Force the connection to close when the response is a 304 Not Modified
and the user has set a "Transfer-Encoding: chunked" header.

RFC 2616 mandates that 304 responses MUST NOT have a body but node.js
used to send out a zero chunk anyway to accommodate clients that don't
have special handling for 304 responses.

It was pointed out that this might confuse reverse proxies to the point
of creating security liabilities, so suppress the zero chunk and force
the connection to close.

11 years agodeps: upgrade libuv to e4d8cba
Bert Belder [Tue, 22 Jan 2013 23:17:01 +0000 (00:17 +0100)]
deps: upgrade libuv to e4d8cba

11 years agodeps: upgrade libuv to 7841f77
Ben Noordhuis [Tue, 22 Jan 2013 15:21:25 +0000 (16:21 +0100)]
deps: upgrade libuv to 7841f77

11 years agodoc: Fix syntax in cluster example code
Tim [Mon, 7 Jan 2013 19:35:42 +0000 (15:35 -0400)]
doc: Fix syntax in cluster example code

11 years agogyp: fix build with dtrace support on FreeBSD
Fedor Indutny [Sun, 20 Jan 2013 15:23:35 +0000 (19:23 +0400)]
gyp: fix build with dtrace support on FreeBSD

Fix undefined reference to `gelf_getsym`... and other undefined symbols
from libelf, by adding `-lelf` to linker options on FreeBSD.

11 years agodtrace: fix generation of v8 constants on freebsd
Fedor Indutny [Sun, 20 Jan 2013 14:31:30 +0000 (18:31 +0400)]
dtrace: fix generation of v8 constants on freebsd

Every constant is certainly 4 bytes now, but freebsd's objdump utility
prints out odd byte sequences (5-bytes, 6-bytes and even 9-bytes long)
for v8's data section. We can safely ignore all upper bytes, because all
constants that we're using are just `int`s. Since on all supported
platforms `int` is 32bit long (and anyway v8's constants are 32bit too),
we ignore all higher bits if they were read.

11 years agotyped arrays: fix DataView endianness regression
Ben Noordhuis [Sat, 19 Jan 2013 23:24:19 +0000 (00:24 +0100)]
typed arrays: fix DataView endianness regression

Fix an off-by-one error introduced in 9fe3734 that caused a regression
in the default endianness used for writes in DataView::setGeneric().

Fixes #4626.

11 years agochild_process: remove .track option
Fedor Indutny [Sat, 19 Jan 2013 20:26:38 +0000 (00:26 +0400)]
child_process: remove .track option

Since net.Server's `connection` property is deprecated now, we don't
need API to track socket's state to keep `connection`s value up-to-date.

11 years agoconsole: Support formatting options in trace()
isaacs [Fri, 18 Jan 2013 00:02:41 +0000 (16:02 -0800)]
console: Support formatting options in trace()

Fix #4589

11 years agodomain: empty stack on all exceptions
Dave Olszewski [Thu, 27 Dec 2012 20:08:23 +0000 (12:08 -0800)]
domain: empty stack on all exceptions

Due to the nature of asyncronous programming, it's impossible to know
what will run on the next tick.  Because of this, it's not correct to
maintain domain stack state between ticks

Since the _fatalException handler is only invoked after the stack is
unwound, once it exits the tick will end.  The only reasonable thing to
do in that case is to exit *all* domains.

11 years agodoc: Add NODE_DEBUG env to the first example.
Yi EungJun [Fri, 18 Jan 2013 13:51:09 +0000 (22:51 +0900)]
doc: Add NODE_DEBUG env to the first example.

The first example in cluster.markdown requires NODE_DEBUG env to show
debug message.

And also fix the message because it was a little bit different with
the actual message.

11 years agoMerge remote-tracking branch 'ry/v0.8' into master
isaacs [Fri, 18 Jan 2013 20:58:16 +0000 (12:58 -0800)]
Merge remote-tracking branch 'ry/v0.8' into master

Conflicts:
AUTHORS
ChangeLog
src/node_version.h
test/simple/test-buffer.js

11 years agoblog: Post for v0.8.18 release
isaacs [Fri, 18 Jan 2013 20:54:22 +0000 (12:54 -0800)]
blog: Post for v0.8.18 release

11 years agoNow working on 0.8.19
isaacs [Fri, 18 Jan 2013 20:51:34 +0000 (12:51 -0800)]
Now working on 0.8.19

11 years agoMerge branch 'v0.8.18-release' into v0.8
isaacs [Fri, 18 Jan 2013 20:51:14 +0000 (12:51 -0800)]
Merge branch 'v0.8.18-release' into v0.8

11 years ago2013.01.18, Version 0.8.18 (Stable) v0.8.18
isaacs [Fri, 18 Jan 2013 20:15:41 +0000 (12:15 -0800)]
2013.01.18, Version 0.8.18 (Stable)

* npm: Upgrade to v1.2.2

* dns: make error message match errno (Dan Milon)

* tls: follow RFC6125 more stricly (Fedor Indutny)

* buffer: reject negative SlowBuffer offsets (Ben Noordhuis)

* install: add simplejson fallback (Chris Dent)

* http: fix "Cannot call method 'emit' of null" (Ben Noordhuis)

11 years agonpm: Upgrade to v1.2.2
isaacs [Fri, 18 Jan 2013 20:12:07 +0000 (12:12 -0800)]
npm: Upgrade to v1.2.2

11 years agoNow working on 0.9.8
isaacs [Fri, 18 Jan 2013 19:49:35 +0000 (11:49 -0800)]
Now working on 0.9.8

11 years agoMerge branch 'v0.9.7-release'
isaacs [Fri, 18 Jan 2013 19:49:12 +0000 (11:49 -0800)]
Merge branch 'v0.9.7-release'

11 years agoblog: Post for v0.9.7 release
isaacs [Fri, 18 Jan 2013 19:48:21 +0000 (11:48 -0800)]
blog: Post for v0.9.7 release

11 years ago2013.01.18, Version 0.9.7 (Unstable) v0.9.7
isaacs [Fri, 18 Jan 2013 16:42:54 +0000 (08:42 -0800)]
2013.01.18, Version 0.9.7 (Unstable)

* V8: Upgrade to 3.15.11.7

* npm: Upgrade to 1.2.2

* punycode: Upgrade to 1.2.0 (Mathias Bynens)

* repl: make built-in modules available by default (Felix Böhm)

* windows: add support for '_Total' perf counters (Scott Blomquist)

* cluster: make --prof work for workers (Ben Noordhuis)

* child_process: do not keep list of sent sockets (Fedor Indutny)

* tls: Follow RFC6125 more strictly (Fedor Indutny)

* buffer: floating point read/write improvements (Trevor Norris)

* TypedArrays: Improve dataview perf without endian param (Dean McNamee)

* module: assert require() called with a non-empty string (Felix Böhm, James Campos)

* stdio: Set readable/writable flags properly (isaacs)

* stream: Properly handle large reads from push-streams (isaacs)

11 years agodoc: Remove mention of child.send 'track' option
isaacs [Fri, 18 Jan 2013 18:17:26 +0000 (10:17 -0800)]
doc: Remove mention of child.send 'track' option

Will be removed very soon.  No point making it public.

11 years agobuffer: Define INFINITY for MSVC compiler
isaacs [Fri, 18 Jan 2013 18:03:54 +0000 (10:03 -0800)]
buffer: Define INFINITY for MSVC compiler

11 years agonpm: Upgrade to 1.2.2
isaacs [Fri, 18 Jan 2013 16:37:32 +0000 (08:37 -0800)]
npm: Upgrade to 1.2.2

11 years agocluster: make --prof work for workers
Ben Noordhuis [Fri, 18 Jan 2013 11:44:10 +0000 (12:44 +0100)]
cluster: make --prof work for workers

Profiling in clustered environments doesn't work out of the box.

By default, V8 writes the profile data of all processes to a single
v8.log.

Running that log file through a tick processor produces bogus numbers
because many events won't match up with the recorded memory mappings
and you end up with graphs where 80+% of ticks is unaccounted for.

Fixing the tick processor to deal with multi-process output is not very
useful because the processes may be running wildly disparate workloads.

That's why we fix up the command line arguments to include
a "--logfile=v8-%p.log" argument (where %p is expanded to the PID)
unless it already contains a --logfile argument.

Fixes #4617.

11 years agodns: make error message match errno
Dan Milon [Fri, 18 Jan 2013 00:40:48 +0000 (02:40 +0200)]
dns: make error message match errno

11 years agov8: add %p option to --logfile, expands to pid
Ben Noordhuis [Fri, 18 Jan 2013 00:23:34 +0000 (01:23 +0100)]
v8: add %p option to --logfile, expands to pid

Useful when you are profiling multiple instances of V8 concurrently.
Submitted upstream: http://code.google.com/p/v8/issues/detail?id=2503

Refs #4617.

11 years agotls: follow RFC6125 more stricly
Fedor Indutny [Mon, 14 Jan 2013 23:29:46 +0000 (03:29 +0400)]
tls: follow RFC6125 more stricly

* Allow wildcards only in left-most part of hostname identifier.
* Do not match CN if altnames are present

11 years agoRevert "Revert "tls: allow wildcards in common name""
Fedor Indutny [Thu, 17 Jan 2013 23:47:47 +0000 (03:47 +0400)]
Revert "Revert "tls: allow wildcards in common name""

This reverts commit 30e237041d5cd7c39e33a9382c96f109be23337d.

Works properly with b4b750b

11 years agochild_process: do not keep list of sent sockets
Fedor Indutny [Mon, 14 Jan 2013 17:08:20 +0000 (21:08 +0400)]
child_process: do not keep list of sent sockets

Keeping list of all sockets that were sent to child process causes memory
leak and thus unacceptable (see #4587). However `server.close()` should
still work properly.

This commit introduces two options:

* child.send(socket, { track: true }) - will send socket and track its status.
  You should use it when you want to receive `close` event on sent sockets.
* child.send(socket) - will send socket without tracking it status. This
  performs much better, because of smaller number of RTT between master and
  child.

With both of these options `server.close()` will wait for all sent
sockets to get closed.

11 years agoRevert "child_process: do not keep list of sent sockets"
Fedor Indutny [Thu, 17 Jan 2013 23:13:10 +0000 (03:13 +0400)]
Revert "child_process: do not keep list of sent sockets"

This reverts commit db5ee0b3decace9b5d80ee535ce53183aff02909.

11 years agobenchmark: Add resume() in static_http_server
isaacs [Thu, 17 Jan 2013 22:54:59 +0000 (14:54 -0800)]
benchmark: Add resume() in static_http_server

11 years agochild_process: do not keep list of sent sockets
Fedor Indutny [Mon, 14 Jan 2013 17:08:20 +0000 (21:08 +0400)]
child_process: do not keep list of sent sockets

Keeping list of all sockets that were sent to child process causes memory
leak and thus unacceptable (see #4587). However `server.close()` should
still work properly.

This commit introduces two options:

* child.send(socket, { track: true }) - will send socket and track its status.
  You should use it when you want `server.connections` to be a reliable
  number, and receive `close` event on sent sockets.
* child.send(socket) - will send socket without tracking it status. This
  performs much better, because of smaller number of RTT between master and
  child.

With both of these options `server.close()` will wait for all sent
sockets to get closed.

11 years agoRevert "events: Don't crash on events named __proto__"
isaacs [Thu, 17 Jan 2013 21:20:22 +0000 (13:20 -0800)]
Revert "events: Don't crash on events named __proto__"

Unfortunately, it's just too slow to do this in events.js.  Users will
just have to live with not having events named __proto__ or toString.

This reverts commit b48e303af023dc60b6f6590694ba94d9b8108702.

11 years agostdio: Set readable/writable flags properly
isaacs [Thu, 17 Jan 2013 17:52:48 +0000 (09:52 -0800)]
stdio: Set readable/writable flags properly

Set the readable/writable flags properly in net streams that have
a handle passed in (such as TTY streams).

Fix #4606

11 years agoevents: Don't crash on events named __proto__
isaacs [Wed, 16 Jan 2013 19:26:28 +0000 (11:26 -0800)]
events: Don't crash on events named __proto__

This prefixes all event names internally with 'ev'.

11 years agoRevert "tls: allow wildcards in common name"
Ben Noordhuis [Thu, 17 Jan 2013 15:32:00 +0000 (16:32 +0100)]
Revert "tls: allow wildcards in common name"

This reverts commit 45024e7b7551eca7796e16fe453b2cbaee94b916.

It's making test/simple/test-tls-check-server-identity.js fail:

  AssertionError: Test#4 failed: { host: 'b.a.com',
    cert: { subject: { CN: '*.a.com' } },
    result: false }
      at <omitted>/test/simple/test-tls-check-server-identity.js:201:10

11 years agodoc: modify documentation style about 'Stability: 5'
Ryunosuke SATO [Thu, 17 Jan 2013 09:12:03 +0000 (18:12 +0900)]
doc: modify documentation style about 'Stability: 5'

'Stability: 5' is described as 'Locked' not as 'API Locked'
in other documents.

For example:
- `/doc/api/assert.markdown`
- `/doc/api/util.markdown`

This word was injected in 192192a.

11 years agotest: add cluster 'bind twice' test
Ben Noordhuis [Thu, 9 Feb 2012 05:22:50 +0000 (06:22 +0100)]
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.

Reapplies commit cacd3ae, accidentally reverted in a2851b6.

11 years agobuffer: reject negative SlowBuffer offsets
Ben Noordhuis [Thu, 17 Jan 2013 00:10:15 +0000 (01:10 +0100)]
buffer: reject negative SlowBuffer offsets

Reject negative offsets in SlowBuffer::MakeFastBuffer(), it allows
the creation of buffers that point to arbitrary addresses.

Reported by Trevor Norris.

11 years agodeps: upgrade libuv to 4ba03dd
Ben Noordhuis [Wed, 16 Jan 2013 22:38:02 +0000 (23:38 +0100)]
deps: upgrade libuv to 4ba03dd

11 years agotest: add module-loading test with empty string
isaacs [Wed, 16 Jan 2013 20:27:53 +0000 (12:27 -0800)]
test: add module-loading test with empty string

11 years agomodule: assert that require() is called with a string
Felix Böhm [Wed, 16 Jan 2013 18:53:16 +0000 (19:53 +0100)]
module: assert that require() is called with a string

as requested in #4577

11 years agolint: Prefer double-quotes over single
isaacs [Wed, 16 Jan 2013 20:07:12 +0000 (12:07 -0800)]
lint: Prefer double-quotes over single

11 years agorepl: fix how to module requiring in code comment
Ryunosuke SATO [Tue, 11 Dec 2012 10:13:22 +0000 (19:13 +0900)]
repl: fix how to module requiring in code comment

This module requiring style is old.
This API has been changed in Node 0.1.16 726865af.

11 years agoTypedArrays: Improve dataview perf without endian param
Dean McNamee [Tue, 15 Jan 2013 18:35:52 +0000 (19:35 +0100)]
TypedArrays: Improve dataview perf without endian param

V8 seems to be particularly slow converting an undefined value to false
in BooleanValue.

Revert this when we upgrade to V8 3.17, or whenever the fix discussed
in http://code.google.com/p/v8/issues/detail?id=2487 lands in V8.

11 years agoassert that require() has a truthy path
James Campos [Wed, 9 Jan 2013 17:01:22 +0000 (09:01 -0800)]
assert that require() has a truthy path

11 years agostream: Properly handle large reads from push-streams
isaacs [Wed, 16 Jan 2013 00:44:29 +0000 (16:44 -0800)]
stream: Properly handle large reads from push-streams

Problem 1: If stream.push() triggers a 'readable' event, and the user
calls `read(n)` with some n > the highWaterMark, then the push() will
return false (indicating that they should not push any more), but no
future 'readable' event is coming (because we're above the
highWaterMark).

Solution: return true from push() when needReadable is set.

Problem 2: A read(n) for n != 0, after the stream had encountered an
EOF, would not trigger the 'end' event if the EOF was pushed in
synchronously by the _read() function.

Solution: Check for ended in stream.read() and schedule an end event if
the length now equals 0.

Fix #4585

11 years agobuffer: improve read/write speed with assert
Trevor Norris [Fri, 11 Jan 2013 00:59:39 +0000 (16:59 -0800)]
buffer: improve read/write speed with assert

Improved assert check order of execution and added additional checks on
parameters to ensure no bad values make it through (e.g. negative offset
values).

11 years agobuffer: floating point read/write improvements
Trevor Norris [Sat, 22 Dec 2012 21:06:50 +0000 (13:06 -0800)]
buffer: floating point read/write improvements

Improvements:
* floating point operations are approx 4x's faster
* Now write quiet NaN's
* all read/write on floating point now done in C, so no more need for
  lib/buffer_ieee754.js
* float values have more accurate min/max value checks
* add additional benchmarks for buffers read/write
* created benchmark/_bench_timer.js which is a simple library that
  can be included into any benchmark and provides an intelligent tracker
  for sync and async tests
* add benchmarks for DataView set methods
* add checks and tests to make sure offset is greater than 0

11 years agohttp: fix duplicate var initialization
Alexandr Emelin [Thu, 10 Jan 2013 07:38:29 +0000 (11:38 +0400)]
http: fix duplicate var initialization

IncomingMessage function contained duplicate initialization
of this._pendings. Line with one of those expressions has been
removed.

11 years agopunycode: update to v1.2.0
Mathias Bynens [Fri, 11 Jan 2013 08:57:24 +0000 (09:57 +0100)]
punycode: update to v1.2.0

This update adds support for RFC 3490 separators for improved
compatibility with web browsers.