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.
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.
Bert Belder [Tue, 22 Jan 2013 22:52:20 +0000 (23:52 +0100)]
cluster: support datagram sockets
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.
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
isaacs [Mon, 28 Jan 2013 16:54:08 +0000 (08:54 -0800)]
http: Don't dump twice
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
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
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.
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)
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.
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.
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.
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
isaacs [Fri, 25 Jan 2013 22:27:46 +0000 (14:27 -0800)]
doc: fix line wrapping in addons.markdown
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
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
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.
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.
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.
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.
Sugendran Ganess [Thu, 6 Dec 2012 00:01:41 +0000 (11:01 +1100)]
doc: Connecting debugger to existing node process
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.
isaacs [Thu, 24 Jan 2013 18:31:40 +0000 (10:31 -0800)]
Now working on v0.9.9
isaacs [Thu, 24 Jan 2013 18:31:23 +0000 (10:31 -0800)]
Merge branch 'v0.9.8-release'
isaacs [Thu, 24 Jan 2013 18:12:19 +0000 (10:12 -0800)]
test: Add transform objectMode test
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)
isaacs [Thu, 24 Jan 2013 17:06:31 +0000 (09:06 -0800)]
npm: Upgrade to v1.2.3
isaacs [Thu, 24 Jan 2013 17:02:21 +0000 (09:02 -0800)]
V8: Reapply floating patches
isaacs [Thu, 24 Jan 2013 16:59:39 +0000 (08:59 -0800)]
V8: Upgrade to 3.15.11.10
Fedor Indutny [Tue, 22 Jan 2013 13:27:05 +0000 (17:27 +0400)]
tls: make slab buffer's size configurable
see #4636
isaacs [Thu, 24 Jan 2013 03:15:03 +0000 (19:15 -0800)]
test: Add test for negative stream drain counter
isaacs [Thu, 24 Jan 2013 01:52:45 +0000 (17:52 -0800)]
streams2: Handle sync read callbacks nicely
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
Ben Noordhuis [Thu, 24 Jan 2013 10:35:29 +0000 (11:35 +0100)]
gitignore: ignore v8.log files
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.
Scott Blomquist [Thu, 17 Jan 2013 06:29:48 +0000 (22:29 -0800)]
build: Add some gyp artifacts to .gitignore
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.
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.
Bert Belder [Tue, 22 Jan 2013 23:17:01 +0000 (00:17 +0100)]
deps: upgrade libuv to e4d8cba
Ben Noordhuis [Tue, 22 Jan 2013 15:21:25 +0000 (16:21 +0100)]
deps: upgrade libuv to 7841f77
Tim [Mon, 7 Jan 2013 19:35:42 +0000 (15:35 -0400)]
doc: Fix syntax in cluster example code
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.
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.
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.
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.
isaacs [Fri, 18 Jan 2013 00:02:41 +0000 (16:02 -0800)]
console: Support formatting options in trace()
Fix #4589
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.
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.
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
isaacs [Fri, 18 Jan 2013 20:54:22 +0000 (12:54 -0800)]
blog: Post for v0.8.18 release
isaacs [Fri, 18 Jan 2013 20:51:34 +0000 (12:51 -0800)]
Now working on 0.8.19
isaacs [Fri, 18 Jan 2013 20:51:14 +0000 (12:51 -0800)]
Merge branch 'v0.8.18-release' into v0.8
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)
isaacs [Fri, 18 Jan 2013 20:12:07 +0000 (12:12 -0800)]
npm: Upgrade to v1.2.2
isaacs [Fri, 18 Jan 2013 19:49:35 +0000 (11:49 -0800)]
Now working on 0.9.8
isaacs [Fri, 18 Jan 2013 19:49:12 +0000 (11:49 -0800)]
Merge branch 'v0.9.7-release'
isaacs [Fri, 18 Jan 2013 19:48:21 +0000 (11:48 -0800)]
blog: Post for v0.9.7 release
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)
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.
isaacs [Fri, 18 Jan 2013 18:03:54 +0000 (10:03 -0800)]
buffer: Define INFINITY for MSVC compiler
isaacs [Fri, 18 Jan 2013 16:37:32 +0000 (08:37 -0800)]
npm: Upgrade to 1.2.2
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.
Dan Milon [Fri, 18 Jan 2013 00:40:48 +0000 (02:40 +0200)]
dns: make error message match errno
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.
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
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
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.
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.
isaacs [Thu, 17 Jan 2013 22:54:59 +0000 (14:54 -0800)]
benchmark: Add resume() in static_http_server
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.
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.
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
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'.
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
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.
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.
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.
Ben Noordhuis [Wed, 16 Jan 2013 22:38:02 +0000 (23:38 +0100)]
deps: upgrade libuv to 4ba03dd
isaacs [Wed, 16 Jan 2013 20:27:53 +0000 (12:27 -0800)]
test: add module-loading test with empty 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
isaacs [Wed, 16 Jan 2013 20:07:12 +0000 (12:07 -0800)]
lint: Prefer double-quotes over single
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.
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.
James Campos [Wed, 9 Jan 2013 17:01:22 +0000 (09:01 -0800)]
assert that require() has a truthy path
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
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).
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
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.
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.
Ben Noordhuis [Tue, 15 Jan 2013 22:42:23 +0000 (23:42 +0100)]
v8: work around String::WriteAscii segfault
See http://code.google.com/p/v8/issues/detail?id=2493 for details.
Once the patch lands in upstream V8, this commit can be reverted.
Chris Dent [Mon, 14 Jan 2013 22:24:30 +0000 (22:24 +0000)]
install: add simplejson fallback
Make tools/install.py work with python 2.5
2.5 is still fairly widespread and does not include a json lib as
standard. Most python folk will have simplejson if they are in that
boat.
In general it seems a bit tricky to solve this perfectly...
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
isaacs [Tue, 15 Jan 2013 00:03:38 +0000 (16:03 -0800)]
streams2: Do not allow hwm < lwm
There was previously an assert() in there, but this part of the code is
so high-volume that the added cost made a measurable dent in http_simple.
Just checking inline is fine, though, and prevents a lot of potential
hazards.
isaacs [Mon, 14 Jan 2013 19:25:39 +0000 (11:25 -0800)]
stream: Do not call endReadable on a non-empty stream
Say that a stream's current read queue has 101 bytes in it, and the
underlying resource has ended (ie, reached EOF).
If you do something like this:
stream.read(100); // leave a byte behind
stream.read(0); // read(0) for some reason
then the read(0) will get 0 from the howMuchToRead function. Since the
stream was ended, this was incorrectly treating the 0 as a "there is no
more in the buffer", and emitting 'end' before that last byte was read.
Why have the read(0) in the first place? We do this in some cases to
trigger the last few bytes of a net socket (such as a child process's
stdio pipes). This was causing issues when piping a `git archive` job
to a file: the resulting tarball was incomplete, because it occasionally
was not getting the last chunk.
Bert Belder [Sat, 5 Jan 2013 21:14:50 +0000 (22:14 +0100)]
buffer: zero-length buffers shouldn't be slab-backed
Bert Belder [Sat, 5 Jan 2013 21:14:50 +0000 (22:14 +0100)]
buffer: zero-length buffers shouldn't be slab-backed
Fedor Indutny [Mon, 14 Jan 2013 17:09:35 +0000 (21:09 +0400)]
tls: allow wildcards in common name
see #4592
Fedor Indutny [Mon, 14 Jan 2013 17:09:35 +0000 (21:09 +0400)]
tls: allow wildcards in common name
see #4592
Ben Noordhuis [Mon, 14 Jan 2013 15:35:03 +0000 (16:35 +0100)]
http: fix "Cannot call method 'emit' of null"
Fix the following exception:
http.js:974
this._httpMessage.emit('close');
^
TypeError: Cannot call method 'emit' of null
at Socket.onServerResponseClose (http.js:974:21)
at Socket.EventEmitter.emit (events.js:124:20)
at net.js:421:10
at process._tickCallback (node.js:386:13)
at process._makeCallback (node.js:304:15)
Fixes #4586.