Commit Graph

8447 Commits (aca275f58db0ce3da247b35588ebec563c7ba937)

Author SHA1 Message Date
isaacs 025f9133bb http: Don't try to destroy nonexistent sockets
Fixes #3740

In the case of pipelined requests, you can have a situation where
the socket gets destroyed via one req/res object, but then trying
to destroy *another* req/res on the same socket will cause it to
call undefined.destroy(), since it was already removed from that
message.

Add a guard to OutgoingMessage.destroy and IncomingMessage.destroy
to prevent this error.
2013-04-22 10:38:14 -07:00
isaacs 01e2920219 http: Don't try to destroy nonexistent sockets
Fixes #3740

In the case of pipelined requests, you can have a situation where
the socket gets destroyed via one req/res object, but then trying
to destroy *another* req/res on the same socket will cause it to
call undefined.destroy(), since it was already removed from that
message.

Add a guard to OutgoingMessage.destroy and IncomingMessage.destroy
to prevent this error.
2013-04-22 09:54:04 -07:00
isaacs 1d794ec43e test: fix dgram-bind-default-address on osx
Allow the IPv4-mapped-as-IPv6 style address.
2013-04-22 08:56:29 -07:00
isaacs 4bf1d1007f crypto: LazyTransform on properties, not methods
It needs to apply the Transform class when the _readableState,
_writableState, or _transformState properties are accessed,
otherwise things like setEncoding and on('data') don't work
properly.

Also, the methods wrappers are no longer needed, since they're only
problematic because they access the undefined properties.
2013-04-21 09:33:10 -04:00
mscdex c4379a5554 src: fix potential memory leak on early return 2013-04-20 23:30:21 -04:00
mscdex 2322580dfb src: don't initialize variable before assignment 2013-04-20 23:30:20 -04:00
Ben Noordhuis 41b75ca926 cluster: clean up lib/cluster.js
Clean up and DRY the cluster source code. Fix a few bugs while we're
here:

* Short-lived handles in long-lived worker processes were never
  reclaimed, resulting in resource leaks.

* Handles in the master process are now closed when the last worker
  that holds a reference to them quits. Previously, they were only
  closed at cluster shutdown.

* The cluster object no longer exposes functions/properties that are
  only valid in the 'other' process, e.g. cluster.fork() is no longer
  exported in worker processes.

So much goodness and still manages to reduce the line count from 590
to 320.
2013-04-20 22:58:16 +02:00
isaacs c77312405e lint 2013-04-19 16:25:11 -07:00
Ben Noordhuis cf0fa96db8 events: add EventEmitter.defaultMaxListeners
Class property that controls the maximum number of listeners for all
instances of EventEmitter.

Fixes #3014.

Conflicts:
	lib/events.js
2013-04-19 16:21:37 -07:00
Ben Noordhuis 2efb6cf0cf v8: reapply floating patches 2013-04-19 10:51:01 -07:00
isaacs 50624a50ee V8: Upgrade to 3.18.1 2013-04-19 10:50:44 -07:00
Ryan Doenges 9026675061 path: add path.isAbsolute(path)
An absolute path will always open the same location regardless of your
current working directory. For posix, this just means path.charAt(0) ===
'/', but on Windows it's a little more complicated.

Fixes joyent/node#5299.
2013-04-19 10:15:22 -07:00
isaacs 0b04abcb10 blog: v0.11.1 does not work on windows x64 2013-04-19 09:22:06 -07:00
isaacs e4406b76df Now working on 0.11.2 2013-04-19 09:14:44 -07:00
isaacs 92277808b6 Merge branch 'v0.11.1-release' 2013-04-19 09:14:24 -07:00
isaacs 223f22a30d blog: Post about 0.11.1 2013-04-19 09:12:53 -07:00
isaacs 56e90dacb3 blog: Post about 0.10.4 2013-04-19 09:12:22 -07:00
isaacs 4babd2b46e 2013.04.19, Version 0.11.1 (Unstable)
* V8: upgrade to 3.18.0

* uv: Upgrade to v0.11.1

* http: split into multiple separate modules (Timothy J Fontaine)

* http: escape unsafe characters in request path (Ben Noordhuis)

* url: Escape all unwise characters (isaacs)

* build: depend on v8 postmortem-metadata if enabled (Paddy Byers)

* etw: update prototypes to match dtrace provider (Timothy J Fontaine)

* buffer: change output of Buffer.prototype.toJSON() (David Braun)

* dtrace: actually use the _handle.fd value (Timothy J Fontaine)

* dtrace: pass more arguments to probes (Dave Pacheco)

* build: allow building with dtrace on osx (Dave Pacheco)

* zlib: allow passing options to convenience methods (Kyle Robinson Young)
2013-04-19 08:32:32 -07:00
isaacs 42b8682a51 test: fix dgram-bind-default-address on osx
Allow the IPv4-mapped-as-IPv6 style address.
2013-04-19 08:32:32 -07:00
Trevor Norris 0a4ebc3d2c src: replace Holder() with This()
Switch to always use args.This() to retrieve object instance.
2013-04-19 15:24:01 +02:00
Ben Noordhuis 223607c90f build: fix arm build after v8 upgrade
V8 was upgraded to 3.18 in commit 9f68226. The knobs that control the
ARM build have changed in a number of ways. This commit patches the
configure script to reflect that. Should fix the Raspberry Pi build.

Fixes #5329.
2013-04-19 14:54:37 +02:00
Sean Silva 63466e5cae doc: document value of `this` inside listeners
Fixes #5326.
2013-04-19 11:58:18 +02:00
isaacs 0bccb341c4 Merge remote-tracking branch 'ry/v0.10' 2013-04-18 16:21:24 -07:00
Ryan Doenges 6101eb184d assert: put info in err.message, not err.name
4716dc6 made assert.equal() and related functions work better by
generating a better toString() from the expected, actual, and operator
values passed to fail(). Unfortunately, this was accomplished by putting
the generated message into the error's `name` property. When you passed
in a custom error message, the error would put the custom error into
`name` *and* `message`, resulting in helpful string representations like
"AssertionError: Oh no: Oh no".

This commit resolves that issue by storing the generated message in the
`message` property while leaving the error's name alone and adding
a regression test so that this doesn't pop back up later.

Closes #5292.
2013-04-18 15:08:35 -07:00
Ben Noordhuis a835a2fc47 website: add link to nightlies on download page 2013-04-18 22:06:04 +02:00
Ben Noordhuis 8e190bf6a1 Merge remote-tracking branch 'origin/v0.10'
Conflicts:
	src/node_os.cc
2013-04-18 12:14:30 +02:00
Trevor Norris 659fb238e7 crypto: fix return Local Handle w/o scope.Close()
A new String was being created and returned, but was not sent through
the scope.Close(), which caused it to be cleaned up before being
returned.
2013-04-18 01:30:36 +02:00
Timothy J Fontaine 39dfe94682 build: libv8_base.a is now libv8_base.<arch>.a
This fixes generating the v8 contstants for dtrace on smartos
2013-04-18 01:18:16 +02:00
Ben Noordhuis 92023b4b37 dgram: fix no address bind()
I broke dgram.Socket#bind(port, cb) almost a year ago in 332fea5a but
it wasn't until today that someone complained and none of the tests
caught it because they all either specify the address or omit the
callback.

Anyway, now it works again and does what you expect: it binds the
socket to the "any" address ("0.0.0.0" for IPv4 and "::" for IPv6.)
2013-04-18 00:54:57 +02:00
Ben Noordhuis 2e70ddad9d test: make stdout-close-unref work in test runner
process.stdout isn't fully initialized yet by the time the test starts
when invoked with `python tools/test.py`. Use process.stdin instead and
force initialization with process.stdin.resume().
2013-04-18 00:02:51 +02:00
Ben Noordhuis f044a6f3fa buffer: upgrade to new V8 profiler API 2013-04-17 16:59:39 +02:00
Ben Noordhuis c7d7072e60 v8: reapply floating patches 2013-04-17 16:10:51 +02:00
Ben Noordhuis 9f682265d6 deps: upgrade v8 to 3.18.0 2013-04-17 16:10:37 +02:00
Timothy J Fontaine 951e0b69fa http: split Client into _http_client.js 2013-04-17 00:08:28 +02:00
Timothy J Fontaine 6717fdccb4 http: move Server and ServerResponse out 2013-04-17 00:08:28 +02:00
Timothy J Fontaine dc9f97b7b9 http: move OutgoingMessage into it's own file 2013-04-17 00:08:28 +02:00
Timothy J Fontaine bb56489f21 http: move parsers into _http_common.js 2013-04-17 00:08:28 +02:00
Timothy J Fontaine 5909a9c9bd http: move IncomingMessage into its own file 2013-04-17 00:08:28 +02:00
Timothy J Fontaine 62e4f89765 http: split Agent into its own file 2013-04-17 00:08:28 +02:00
Kelly Gerber 36503b523d docs: update path.join() example for v0.10
The current example shows the behavior of v0.8. In v0.10 arguments
to path.join() must be strings; otherwise, an exception is thrown.
2013-04-17 00:04:17 +02:00
Ryan Graham b02b93b2a2 doc: note a gotcha with http.Server sockets 2013-04-16 23:44:00 +02:00
Ben Noordhuis ccd37226c6 handle_wrap: fix NULL pointer dereference
Fix a NULL pointer dereference in src/handle_wrap.cc which is really a
use-after-close bug.

The test checks that unref() after close() works on process.stdout but
this bug affects everything that derives from HandleWrap. I discovered
it because child processes would sometimes quit for no reason (that is,
no reason until I turned on core dumps.)
2013-04-16 23:11:03 +02:00
Stanislav Ochotnicky 7592615aaa test: preserve process.env after test-init exec
When LD_LIBRARY_PATH is overriden for custom builds we need to preserve
it for child processes. To be sure we preserve whole environment of
parent process and just add TEST_INIT variable to it.
2013-04-16 17:05:51 +02:00
Stanislav Ochotnicky 47198af55a test: preserve process.env in forked child_process
When LD_LIBRARY_PATH is overriden for custom builds we need to preserve
it for forked process. There are possibly other environment variables
that could cause test failures so we preserve whole environment of
parent process.
2013-04-16 17:05:51 +02:00
Ben Noordhuis d58ee7e5c7 os: unbreak windows build
Windows doesn't have MAXHOSTNAMELEN. Introduced in afbadde.
2013-04-15 22:39:03 +02:00
Ben Noordhuis afbaddecd3 os: handle 256 character hostnames
Fix a (rather academic) buffer overflow. MAXHOSTNAMELEN is 256 on most
platforms, which means the buffer wasn't big enough to hold the
trailing nul byte on a system with a maximum length hostname.
2013-04-15 21:13:29 +02:00
Ben Noordhuis 78c5de598b os: fix unlikely buffer overflow in os.type()
* Fix a buffer overflow that happens iff strlen(info.sysname) > 255.
* Check the return value of uname().
2013-04-15 20:57:14 +02:00
Ben Noordhuis 31d0d5af8e test: add extra checks 2013-04-12 16:27:50 -07:00
Ben Noordhuis 38149bb048 http: escape unsafe characters in request path
Make http.request() and friends escape unsafe characters in the request
path. That is, a request for '/foo bar' is now escaped as '/foo%20bar'.

Before this commit, the path was used as-is in the request status line,
creating an invalid HTTP request ("GET /foo bar HTTP/1.1").

Fixes #4381.
2013-04-12 16:27:50 -07:00
isaacs 881ef7cc5f url: ~ is not actually an unwise char 2013-04-12 16:27:49 -07:00