Commit Graph

9392 Commits (001f9b46e72ac98b29b845630bfc88d481c559ad)

Author SHA1 Message Date
Timothy J Fontaine 001f9b46e7 Merge remote-tracking branch 'upstream/v0.10'
Conflicts:
	src/stream_wrap.cc
2013-12-01 19:43:34 -08:00
Timothy J Fontaine 6877e64fa8 build: include postmortem symbols on linux
Previously we were building the symbols, but the linker was garbage
collecting the symbols because they weren't used. Inform the linker
that we want to keep all symbols from v8 around.
2013-12-01 18:57:43 -08:00
Yazhong Liu fcfaa392ae doc: net: fix typo in example code 2013-11-30 14:05:45 +01:00
Michael Ridgway a32b8787a4 doc: http: document ServerResponse 'finish' event 2013-11-28 22:35:25 +01:00
Nikolai Vavilov 207a3e10f8 doc: http: properly document callback argument 2013-11-28 22:31:11 +01:00
Fedor Indutny 5ce4eed54d http: fix parser double-free in _http_client.js
HTTP Parser instance was freed twice, leading to the reusal of it
in several different requests simultaneously.

The flow:

`socketCloseListener` is firing, which calls `socket.read()` to flush
any queued data, `socket.buffer` has data which emits and fires
`socketOnData` in sync, this triggers a parser error which frees the
parser, `socketCloseListener` resumes execution only to have the wrong
parser associated with the socket.

The fix is to only cache the parser after the flushing from the socket,
and to assert in `socketOnData` that `socket === parser.socket`

fix #6451
2013-11-27 15:37:56 -08:00
Alexis Campailla c749a841cd test: use os.EOL when checking output 2013-11-27 10:56:24 -08:00
Fedor Indutny 04b92632bd openssl: more asm 2013-11-27 20:39:57 +04:00
Ben Noordhuis 658aeb2ca0 stream_wrap: don't call Number::New()
Replace call to Number::New() with a call to Integer::NewFromUnsigned().

Profiling a Real World(TM) application with perf(1) suggests that the
conversion of its argument from integer to double is disproportionally
costly: over 60% of CPU cycles accountable to WriteStringImpl() are
attributable to the conversion.

After changing it to Integer::NewFromUnsigned(), WriteStringImpl()
has dropped from the 'most costly functions' top ten altogether.
2013-11-27 03:53:45 +01:00
Timothy J Fontaine 85c19175ed Merge remote-tracking branch 'upstream/v0.10' 2013-11-26 08:41:09 -08:00
isaacs 90655a998e blog: npm outage postmortem 2013-11-26 07:27:59 -08:00
Ben Noordhuis 84c03a984a tls: add serialNumber to getPeerCertificate()
Add a 'serialNumber' property to the object that is returned by
tls.CryptoStream#getPeerCertificate().  Contains the certificate's
serial number encoded as a hex string.  The format is identical to
`openssl x509 -serial -in path/to/certificate`.

Fixes #6583.
2013-11-26 14:24:37 +01:00
David Chan b3e4fc6a48 util: Format negative zero as '-0'
Format negative zero as '-0' instead of as '0', as it does not behave
identically to positive zero. ((-0).toString() still returns '0' as
required by ES5 9.8.1.2).

Fixes joyent/node#6548.
Closes joyent/node#6550.
2013-11-25 11:28:30 -08:00
Ben Noordhuis de8c0a51a7 v8: unbreak freebsd build
Pending review of https://codereview.appspot.com/31500043/

Fixes #6576.
2013-11-23 23:07:41 +01:00
Vladimir Kurchatkin 16a402c0b5 node: fix removing AsyncListener in callback
context._asyncQueue shouldn't be exposed as asyncQueue, as it allows
modification of queues already attached to an event. Which is not
supposed to happend. Instead context._asyncQueue should be copied.
2013-11-23 11:16:16 -08:00
Linus Unnebäck 953d7184ec doc: clarify child_process error behaviour
Clarify that an 'error' event may or may not be followed by an 'exit'
event and that it's not safe to make assumptions either way.
2013-11-23 15:46:50 +01:00
Jeremy Martin 71aabedad4 events: fix TypeError in removeAllListeners
Check that `listeners` is actually an array before trying to manipulate it
because it won't be if no regular event listeners have been registered yet
but there are 'removeListener' event listeners.
2013-11-22 17:42:34 +01:00
Trevor Norris 5757642e91 node: allow nextTick infinite recursion
Removing the depth counter while processing the nextTickQueue made it
possible to run out of memory if in an infinite recursive loop using
nextTick(). There was also an edge case where too many callbacks were
pushed onto the nextTickQueue, while not actually being recursive.

This is being done to prevent possible cryptic FATAL ERROR messages from
popping up, and issues being posted about them.
2013-11-21 15:01:53 -08:00
Timothy J Fontaine a34bbaf31b blog: Post for v0.11.9 2013-11-20 16:45:27 -08:00
Timothy J Fontaine 1a7d3e2b72 Now working on 0.11.10 2013-11-20 16:40:47 -08:00
Timothy J Fontaine 9b985e58a9 Merge branch 'v0.11.9-release' 2013-11-20 16:40:36 -08:00
Timothy J Fontaine dcfd032bdd 2013.11.20, Version 0.11.9 (Unstable)
* uv: upgrade to v0.11.15 (Timothy J Fontaine)

* v8: upgrade to 3.22.24.5 (Timothy J Fontaine)

* buffer: remove warning when no encoding is passed (Trevor Norris)

* build: make v8 use random seed for hash tables (Ben Noordhuis)

* crypto: build with shared openssl without NPN (Ben Noordhuis)

* crypto: update root certificates (Ben Noordhuis)

* debugger: pass on v8 debug switches (Ben Noordhuis)

* domain: use AsyncListener API (Trevor Norris)

* fs: add recursive subdirectory support to fs.watch (Nick Simmons)

* fs: make fs.watch() non-recursive by default (Ben Noordhuis)

* http: cleanup freeSockets when socket destroyed (fengmk2)

* http: force socket encoding to be null (isaacs)

* http: make DELETE requests set `req.method` (Nathan Rajlich)

* node: add AsyncListener support (Trevor Norris)

* src: remove global HandleScope that hid memory leaks (Ben Noordhuis)

* tls: add ECDH ciphers support (Erik Dubbelboer)

* tls: do not default to 'localhost' servername (Fedor Indutny)

* tls: more accurate wrapping of connecting socket (Fedor Indutny)
2013-11-20 16:03:31 -08:00
Timothy J Fontaine eaba9417b1 Merge remote-tracking branch 'upstream/v0.10'
Conflicts:
	lib/events.js
	src/udp_wrap.cc
2013-11-20 15:45:50 -08:00
isaacs c1452f4c6f npm: Upgrade to v1.3.15 2013-11-20 11:08:52 -08:00
Timothy J Fontaine 40d5e9074a child_process: deliver ENOENT on nextTick
After the uv upgrade, uv_spawn will now fail faster for certain
failures like ENOENT. However, our tests and other people may be
depending on that error being passed to the callback instead of a
throw.
2013-11-20 09:35:08 -08:00
Timothy J Fontaine 1fef66ffd4 uv: upgrade to v0.11.15 2013-11-20 09:35:08 -08:00
Trevor Norris aef652dc11 asyncwrap: add missing TryCatch
The TryCatch was not being checked after calling the unload asyncQueue
callback in AsyncWrap::MakeCallback.
2013-11-19 16:03:11 -08:00
Ben Noordhuis 3ac6946999 src: add ASSERT/CHECK/UNREACHABLE macros 2013-11-20 00:26:30 +01:00
Ben Noordhuis d29fe0f2c6 src: make queue.h c++ compatible
This is a cherry-pick of commit joyent/libuv@0520464.
2013-11-20 00:26:30 +01:00
Fedor Indutny 88dc1fcb62 crypto: `randomBytes` is non-blocking
Add NOTE section in documentation, mentioning that `randomBytes` won't
block when entropy sources are drained.

fix #6372
2013-11-19 13:15:50 +04:00
Fedor Indutny fce0eb416b events: do not accept NaN in setMaxListeners 2013-11-19 13:14:01 +04:00
Fedor Indutny 5885f464f0 net: fix `new net.Socket` documentation
`Socket` no longer accepts `type` option, and also accepts `readable`,
`writable` options.

fix #6541
2013-11-19 12:50:16 +04:00
Fedor Indutny 5ce50ece16 dgram: fix abort when getting `fd` of closed dgram
v8's `messages.js` file's `CallSiteGetMethodName` is running through all
object properties and getter to figure out method name of function that
appears in stack trace. This run-through will also read `fd` property of
`UDPWrap` instance's javascript object, making `UNWRAP()` fail.

As a simple alternative to the test case above, one could just keep
reference to the dgram handle and try accessing `handle.fd` after it has
been fully closed.

fix #6536
2013-11-19 12:44:06 +04:00
Timothy J Fontaine b73967e9a0 v8: upgrade to 3.22.24.5 2013-11-18 15:01:38 -08:00
Timothy J Fontaine 2329a254b4 Merge remote-tracking branch 'upstream/v0.10'
Conflicts:
	AUTHORS
	ChangeLog
	deps/uv/AUTHORS
	deps/uv/ChangeLog
	deps/uv/README.md
	deps/uv/build.mk
	deps/uv/src/unix/core.c
	deps/uv/src/unix/darwin-proctitle.c
	deps/uv/src/unix/darwin.c
	deps/uv/src/unix/fsevents.c
	deps/uv/src/unix/udp.c
	deps/uv/src/version.c
	deps/v8/src/platform-solaris.cc
	deps/v8/test/cctest/test-api.cc
	lib/tls.js
	src/node.h
	src/node_version.h
2013-11-18 13:41:17 -08:00
Ben Noordhuis bd9c66668c debugger: pass on v8 debug switches
Before this commit, passing --debugger and other V8 debug switches to
node.js made node print a usage message and exit.

Rewrite the debug argument parser so it only consumes switches that we
understand and pass everything else as-is to V8.

A side effect of this change is that switches like --debugger_agent and
--debugger_port now work.  That kind of obsoletes our debugger switches
because they implement pretty much the same functionality but let's
leave them in for now for the sake of convenience and backwards
compatibility.

Fixes #6526.
2013-11-16 14:53:56 +01:00
Trevor Norris d6df1b9157 buffer: convert values to uint, not int
In many cases values expected to be unsigned were converted to a signed
integer.

Also include some small code cleanup.
2013-11-15 11:48:09 -08:00
Trevor Norris e5346932bc src: make buffer size errors more explicit
Fixes #6490
2013-11-15 11:48:08 -08:00
Trevor Norris a263abaa81 buffer: no warning when encoding isn't passed
Buffer#write() was showing the deprecation warning when only
buf.write('string') was passed. This is incorrect since the encoding is
always optional.

Argument order should follow:
  Buffer#write(string[, offset[, length]][, encoding])

(yeah, not confusing at all)
2013-11-15 11:48:03 -08:00
Ben Noordhuis 1394d5856b doc: add nodejs.vn to community page
Node.js.  It's not just for SF hipsters anymore.
2013-11-15 16:29:30 +01:00
Ben Noordhuis a763db8fc0 doc: sort community page links alphabetically
This commit introduces some long lines but it's HTML so it's okay.
2013-11-15 16:24:47 +01:00
Ben Noordhuis 85c8eeb838 src: remove unused import in cares_wrap.cc 2013-11-14 01:59:07 +01:00
Trevor Norris 26a795baa1 doc: fix few smalloc entries for proper formatting 2013-11-13 15:31:22 -08:00
Trevor Norris c414ec1c2c smalloc: check if object has external memory
Add HasExternalData API to check if Object has externally allocated
memory, and accompanying tests.
2013-11-13 15:29:50 -08:00
Fedor Indutny 65b127572f tls: handle `ssl.start()` errors 2013-11-13 17:09:25 +04:00
Tim Wood c9d93f3431 events: don't call once twice
Emitting an event within a `EventEmitter#once` callback of the same
event name will cause subsequent `EventEmitter#once` listeners of the
same name to be called multiple times.

    var emitter = new EventEmitter();

    emitter.once('e', function() {
      emitter.emit('e');
      console.log(1);
    });

    emitter.once('e', function() {
      console.log(2);
    });

    emitter.emit('e');

    // Output
    // 2
    // 1
    // 2

Fix the issue, by calling the listener method only if it was not
already called.
2013-11-13 03:21:04 +04:00
Trevor Norris 9b4aa355e3 src: add comments about implicit dependencies 2013-11-12 13:38:31 -08:00
Trevor Norris d120d92bfe base-object: add BaseObject
BaseObject is a class that just handles the Persistent handle attached
to the class instance.

This also removed WeakObject. Reordering the inheritance chain helps
prevent unneeded calls on instances that don't call MakeCallback.
2013-11-12 13:38:31 -08:00
Trevor Norris 6cea16f2c9 async-wrap: make typenames consistent 2013-11-12 13:38:30 -08:00
Trevor Norris 4326c6d1b3 tls_wrap: move members to initialization list
They didn't need to be defined in the body of the constructor.
2013-11-12 13:38:30 -08:00