platform/upstream/nodejs.git
11 years agobuild: set `process.platform` to "sunos" on SunOS
Nathan Rajlich [Wed, 29 Aug 2012 21:57:25 +0000 (14:57 -0700)]
build: set `process.platform` to "sunos" on SunOS

gyp sets it to "solaris" by default, but versions of node v0.6.x and
older would report "sunos". Let's keep things consistent.

Fixes #3944.

11 years agodeps: upgrade http_parser to ad3b631
Ben Noordhuis [Wed, 29 Aug 2012 22:06:47 +0000 (00:06 +0200)]
deps: upgrade http_parser to ad3b631

11 years agotls, https: throw exception on missing key/cert
Ben Noordhuis [Wed, 29 Aug 2012 20:53:00 +0000 (22:53 +0200)]
tls, https: throw exception on missing key/cert

Throw an exception in the tls.Server constructor when the options object
doesn't contain either a PFX or a key/certificate combo.

Said change exposed a bug in simple/test-tls-junk-closes-server. Addressed.

Fixes #3941.

11 years agodoc: update assert.doesNotThrow() docs
Ben Noordhuis [Wed, 29 Aug 2012 00:30:15 +0000 (02:30 +0200)]
doc: update assert.doesNotThrow() docs

It takes an optional "expected exception" argument that is not used meaningfully
but is nevertheless documented. Undocument it, it confuses casual readers of the
documentation.

Fixes #3935.

11 years agoNow working on 0.9.2
isaacs [Tue, 28 Aug 2012 22:32:01 +0000 (15:32 -0700)]
Now working on 0.9.2

11 years agoMerge branch 'v0.9.1-release'
isaacs [Tue, 28 Aug 2012 22:31:40 +0000 (15:31 -0700)]
Merge branch 'v0.9.1-release'

11 years ago2012.08.28, Version 0.9.1 (Unstable) v0.9.1
isaacs [Tue, 28 Aug 2012 15:46:29 +0000 (08:46 -0700)]
2012.08.28, Version 0.9.1 (Unstable)

* buffer: Add Buffer.isEncoding(enc) to test for valid encoding values (isaacs)

* Raise UV_ECANCELED on premature close. (Ben Noordhuis)

* Remove c-ares from libuv, move to a top-level node dependency (Bert Belder)

* ref/unref for all HandleWraps, timers, servers, and sockets (Timothy J Fontaine)

* addon: remove node-waf, superseded by node-gyp (Ben Noordhuis)

* child_process: emit error on exec failure (Ben Noordhuis)

* cluster: do not use internal server API (Andreas Madsen)

* constants: add O_DIRECT (Ian Babrou)

* crypto: add sync interface to crypto.pbkdf2() (Ben Noordhuis)

* darwin: emulate fdatasync() (Fedor Indutny)

* dgram: make .bind() always asynchronous (Ben Noordhuis)

* events: Make emitter.listeners() side-effect free (isaacs, Joe Andaverde)

* fs: Throw early on invalid encoding args (isaacs)

* fs: fix naming of truncate/ftruncate functions (isaacs)

* http: bubble up parser errors to ClientRequest (Brian White)

* linux: improve cpuinfo parser on ARM and MIPS (Ben Noordhuis)

* net: add support for IPv6 addresses ending in :: (Josh Erickson)

* net: support Server.listen(Pipe) (Andreas Madsen)

* node: don't scan add-on for "init" symbol (Ben Noordhuis)

* remove process.uvCounters() (Ben Noordhuis)

* repl: console writes to repl rather than process stdio (Nathan Rajlich)

* timers: implement setImmediate (Timothy J Fontaine)

* tls: fix segfault in pummel/test-tls-ci-reneg-attack (Ben Noordhuis)

* tools: Move gyp addon tools to node-gyp (Nathan Rajlich)

* unix: preliminary signal handler support (Ben Noordhuis)

* unix: remove dependency on ev_child (Ben Noordhuis)

* unix: work around darwin bug, don't poll() on pipe (Fedor Indutny)

* util: Formally deprecate util.pump() (Ben Noordhuis)

* windows: make active and closing handle state independent (Bert Belder)

* windows: report spawn errors to the exit callback (Bert Belder)

* windows: signal handling support with uv_signal_t (Bert Belder)

11 years agotest: make test-fs-truncate pass on windows
Bert Belder [Tue, 28 Aug 2012 22:16:53 +0000 (00:16 +0200)]
test: make test-fs-truncate pass on windows

11 years agouv: upgrade to abc945b
Bert Belder [Tue, 28 Aug 2012 20:49:34 +0000 (22:49 +0200)]
uv: upgrade to abc945b

11 years agouv: upgrade to 162e57b
Bert Belder [Tue, 28 Aug 2012 19:50:33 +0000 (21:50 +0200)]
uv: upgrade to 162e57b

11 years agowindows: make test-child-process-exec-error pass
Bert Belder [Tue, 28 Aug 2012 19:46:44 +0000 (21:46 +0200)]
windows: make test-child-process-exec-error pass

11 years agoconstants: add O_DIRECT
Ian Babrou [Tue, 28 Aug 2012 07:03:51 +0000 (11:03 +0400)]
constants: add O_DIRECT

This will allow to speed up file i/o in some cases by usage of right offsets
and buffer sizes.

11 years agoMerge branch 'v0.8'
Bert Belder [Tue, 28 Aug 2012 00:54:22 +0000 (02:54 +0200)]
Merge branch 'v0.8'

Conflicts:
ChangeLog
deps/openssl/openssl.gyp
src/node_version.h

11 years agouv: upgrade to 621a4e3
Bert Belder [Tue, 28 Aug 2012 00:43:55 +0000 (02:43 +0200)]
uv: upgrade to 621a4e3

11 years agowindows: fix single-accept mode for shared server sockets
Bert Belder [Mon, 27 Aug 2012 22:26:29 +0000 (00:26 +0200)]
windows: fix single-accept mode for shared server sockets

11 years agobuild: compile with -fno-tree-sink if gcc <= 4.4
Ben Noordhuis [Mon, 27 Aug 2012 20:08:06 +0000 (22:08 +0200)]
build: compile with -fno-tree-sink if gcc <= 4.4

Fixes a 'pure virtual method called' run-time error with some versions of gcc
on some platforms, notably ARM.

11 years agobuild: fix -fno-tree-vrp heuristic
Ben Noordhuis [Mon, 27 Aug 2012 20:06:34 +0000 (22:06 +0200)]
build: fix -fno-tree-vrp heuristic

-fno-tree-vrp is a gcc only switch. Don't enable it when compiling with clang,
it will only complain about -fno-tree-vrp being ignored.

11 years agolint
isaacs [Mon, 27 Aug 2012 19:51:25 +0000 (12:51 -0700)]
lint

11 years agofs: Throw early on invalid encoding args
isaacs [Mon, 27 Aug 2012 19:40:05 +0000 (12:40 -0700)]
fs: Throw early on invalid encoding args

Re #3918

11 years agoBuffer.isEncoding(enc)
isaacs [Mon, 27 Aug 2012 19:31:14 +0000 (12:31 -0700)]
Buffer.isEncoding(enc)

Re: #3918

11 years agodocs: fix syntax error in "https" example
Nathan Rajlich [Fri, 24 Aug 2012 23:11:55 +0000 (16:11 -0700)]
docs: fix syntax error in "https" example

11 years agorepl: create a new Console instance for the repl when "useGlobal" is off
Nathan Rajlich [Fri, 24 Aug 2012 20:18:19 +0000 (13:18 -0700)]
repl: create a new Console instance for the repl when "useGlobal" is off

Now `console.log('blah')` will work in a REPL running over a socket.

Closes #3876.

11 years agoconsole: refactor the console module to be reusable
Nathan Rajlich [Fri, 24 Aug 2012 20:12:30 +0000 (13:12 -0700)]
console: refactor the console module to be reusable

So that multiple instances can be created pointing
to different writable streams.

This is needed for #3876.

11 years agotools: fix missing initializer warning in js2c.py
Ben Noordhuis [Fri, 24 Aug 2012 20:56:26 +0000 (22:56 +0200)]
tools: fix missing initializer warning in js2c.py

Fix a -Wmissing-field-initializers style compiler warning in the code that's
generated by js2c.py.

11 years agohttp: bubble up parser errors to ClientRequest
Brian White [Tue, 7 Aug 2012 00:42:13 +0000 (20:42 -0400)]
http: bubble up parser errors to ClientRequest

Make parser errors bubble up to the ClientRequest instead of the underlying
net.Socket object.

Fixes #3776.

11 years agohttps: make https.get() accept a URL
koichik [Sat, 18 Aug 2012 05:18:02 +0000 (14:18 +0900)]
https: make https.get() accept a URL

https.get() now accepts either a URL (as a string) or an options object.

Refs #2859.
Fixes #3882.

11 years agodoc: more uniform and sleek buttons
Brandon Wilson [Fri, 24 Aug 2012 13:47:53 +0000 (15:47 +0200)]
doc: more uniform and sleek buttons

Closes GH-3909

11 years agobuild: tweak the openssl android configuration to build
Nathan Rajlich [Thu, 23 Aug 2012 18:28:47 +0000 (11:28 -0700)]
build: tweak the openssl android configuration to build

Removed NO_CAST, NO_MD2 and NO_STORE because otherwise there were build errors.

Added NO_CAMELLIA, NO_MDC2, and NO_CMS because otherwise there were linker errors.

11 years agobuild: use the openssl android configuration for "arm" builds
Nathan Rajlich [Thu, 23 Aug 2012 18:28:17 +0000 (11:28 -0700)]
build: use the openssl android configuration for "arm" builds

11 years agodoc: tidy the community page html file
Bert Belder [Thu, 23 Aug 2012 15:51:59 +0000 (17:51 +0200)]
doc: tidy the community page html file

11 years agodoc: remove Felix's IRC logs from the community page
Bert Belder [Thu, 23 Aug 2012 14:13:37 +0000 (16:13 +0200)]
doc: remove Felix's IRC logs from the community page

It's been down for months.

11 years agodoc: move ul styling to pipe.css
Bert Belder [Thu, 23 Aug 2012 13:50:34 +0000 (15:50 +0200)]
doc: move ul styling to pipe.css

11 years agodoc: pixel nudge
Bert Belder [Thu, 23 Aug 2012 13:42:34 +0000 (15:42 +0200)]
doc: pixel nudge

11 years agodoc: use somewhat consistent styling for css assets
Bert Belder [Thu, 23 Aug 2012 15:54:12 +0000 (17:54 +0200)]
doc: use somewhat consistent styling for css assets

11 years agodoc: remove nodejs-dev from the community page
Stéphan Kochen [Thu, 23 Aug 2012 13:55:42 +0000 (16:55 +0300)]
doc: remove nodejs-dev from the community page

11 years agonet: fix asserts
Ben Noordhuis [Thu, 23 Aug 2012 14:03:46 +0000 (16:03 +0200)]
net: fix asserts

Fixes a 'Converting circular structure to JSON' TypeError.

11 years agowebsite: Fix download link on win, un-break industry section
isaacs [Wed, 22 Aug 2012 22:11:26 +0000 (15:11 -0700)]
website: Fix download link on win, un-break industry section

11 years agodoc: remote the "recommended modules" section
Bert Belder [Wed, 22 Aug 2012 21:58:34 +0000 (23:58 +0200)]
doc: remote the "recommended modules" section

11 years agoblog: v0.8.8 release
isaacs [Wed, 22 Aug 2012 19:53:22 +0000 (12:53 -0700)]
blog: v0.8.8 release

11 years agoNow working on 0.8.9
isaacs [Wed, 22 Aug 2012 19:52:05 +0000 (12:52 -0700)]
Now working on 0.8.9

11 years agoMerge branch 'v0.8.8-release' into v0.8
isaacs [Wed, 22 Aug 2012 19:51:53 +0000 (12:51 -0700)]
Merge branch 'v0.8.8-release' into v0.8

11 years agoUpgrade GYP to r1477
Ryan Dahl [Wed, 22 Aug 2012 19:18:45 +0000 (15:18 -0400)]
Upgrade GYP to r1477

11 years ago2012.08.22, Version 0.8.8 (Stable) v0.8.8
isaacs [Wed, 22 Aug 2012 08:23:47 +0000 (01:23 -0700)]
2012.08.22, Version 0.8.8 (Stable)

* V8: upgrade to 3.11.10.19

* npm: upgrade to 1.1.59

* windows: fix uninitialized memory access in uv_update_time() (Bert Belder)

* unix, windows: fix memory corruption in fs-poll.c (Ben Noordhuis)

* unix: fix integer overflow in uv_hrtime (Tim Holy)

* sunos: fix uv_cpu_info() on x86_64 (Ben Noordhuis)

* tls: update default cipher list (Ben Noordhuis)

* unix: Fix llvm and older gcc duplicate symbol warnings (Bert Belder)

* fs: fix use after free in stat watcher (Ben Noordhuis)

* build: Fix using manually compiled gcc on OS X (Nathan Rajlich)

* windows: make junctions work again (Bert Belder)

11 years agonpm: Upgrade to 1.1.59
isaacs [Wed, 22 Aug 2012 08:19:50 +0000 (01:19 -0700)]
npm: Upgrade to 1.1.59

11 years agolint
isaacs [Wed, 22 Aug 2012 16:46:07 +0000 (09:46 -0700)]
lint

11 years agobuild: compile with -Wextra -Wno-unused-parameter
Ben Noordhuis [Wed, 22 Aug 2012 08:05:18 +0000 (10:05 +0200)]
build: compile with -Wextra -Wno-unused-parameter

11 years agodoc: fix typo in cluster example code
Ron Korving [Tue, 21 Aug 2012 08:11:04 +0000 (17:11 +0900)]
doc: fix typo in cluster example code

11 years agonpm: Upgrade to 1.1.57
isaacs [Wed, 22 Aug 2012 00:38:21 +0000 (17:38 -0700)]
npm: Upgrade to 1.1.57

11 years agonpm: Upgrade to 1.1.56
isaacs [Tue, 21 Aug 2012 23:27:30 +0000 (16:27 -0700)]
npm: Upgrade to 1.1.56

11 years agouv: upgrade to 564e7c7
Bert Belder [Tue, 21 Aug 2012 22:54:15 +0000 (00:54 +0200)]
uv: upgrade to 564e7c7

11 years agonpm: Upgrade to 1.1.55
isaacs [Tue, 21 Aug 2012 22:29:03 +0000 (15:29 -0700)]
npm: Upgrade to 1.1.55

11 years agotls: update default cipher list
Ben Noordhuis [Tue, 21 Aug 2012 20:27:13 +0000 (22:27 +0200)]
tls: update default cipher list

Update the default cipher list from RC4-SHA:AES128-SHA:AES256-SHA
to ECDHE-RSA-AES128-SHA256:AES128-GCM-SHA256:RC4:HIGH:!MD5:!aNULL:!EDH
in order to mitigate BEAST attacks.

The documentation suggested AES256-SHA but unfortunately that's a CBC cipher
and therefore susceptible to attacks.

Fixes #3900.

11 years agochild_process: emit error on exec failure
Ben Noordhuis [Tue, 21 Aug 2012 11:29:53 +0000 (13:29 +0200)]
child_process: emit error on exec failure

libuv calls the exit cb with exit code == -1 when it fails to spawn the new
process. Anticipate that and emit the error on the ChildProcess object.

11 years agodoc: cluster: setupMaster() can be called only once
Ben Noordhuis [Tue, 21 Aug 2012 11:44:29 +0000 (13:44 +0200)]
doc: cluster: setupMaster() can be called only once

11 years agosignal_wrap: fix unused variable compiler warning
Ben Noordhuis [Tue, 21 Aug 2012 10:50:34 +0000 (12:50 +0200)]
signal_wrap: fix unused variable compiler warning

11 years agov8: reapply floating patches
Bert Belder [Tue, 21 Aug 2012 01:05:25 +0000 (03:05 +0200)]
v8: reapply floating patches

11 years agov8: upgrade to v3.11.10.19
Bert Belder [Tue, 21 Aug 2012 01:04:16 +0000 (03:04 +0200)]
v8: upgrade to v3.11.10.19

11 years agoRemove node_io_watcher
Bert Belder [Mon, 20 Aug 2012 22:37:59 +0000 (00:37 +0200)]
Remove node_io_watcher

11 years agoDelete the old node_signal_watcher code
Bert Belder [Mon, 20 Aug 2012 22:32:45 +0000 (00:32 +0200)]
Delete the old node_signal_watcher code

11 years agoprocess: use uv_signal instead of ev_signal
Bert Belder [Mon, 20 Aug 2012 21:59:21 +0000 (23:59 +0200)]
process: use uv_signal instead of ev_signal

11 years agounix: don't explicitly instantiate v8::Persistent<x> templates
Bert Belder [Mon, 20 Aug 2012 16:13:05 +0000 (19:13 +0300)]
unix: don't explicitly instantiate v8::Persistent<x> templates

These explicit instantiations were added to make MSVC happy. It turns
out that some older versions of gcc and llvm now complain about duplicate
symbols, so we instantiate these templates only when MSVC is used.

11 years agouv: upgrade to 8073a26
Bert Belder [Mon, 20 Aug 2012 16:41:07 +0000 (18:41 +0200)]
uv: upgrade to 8073a26

11 years agounix: don't explicitly instantiate v8::Persistent<x> templates
Bert Belder [Mon, 20 Aug 2012 16:13:05 +0000 (19:13 +0300)]
unix: don't explicitly instantiate v8::Persistent<x> templates

These explicit instantiations were added to make MSVC happy. It turns
out that some older versions of gcc and llvm now complain about duplicate
symbols, so we instantiate these templates only when MSVC is used.

11 years agofs: fix use after free in stat watcher
Ben Noordhuis [Mon, 20 Aug 2012 10:52:26 +0000 (12:52 +0200)]
fs: fix use after free in stat watcher

The uv_fs_poll_t handle was stopped but not closed, leaving libuv's internal
handle queue in a corrupted state.

11 years agodeps: upgrade libuv to 012cbda
Ben Noordhuis [Mon, 20 Aug 2012 15:20:41 +0000 (17:20 +0200)]
deps: upgrade libuv to 012cbda

11 years agobuild: don't use "-Wnewline-eof" on OS X
Nathan Rajlich [Sun, 19 Aug 2012 18:11:47 +0000 (11:11 -0700)]
build: don't use "-Wnewline-eof" on OS X

This is the only thing preventing a manually compiled version of GCC
(rather than Apple's provided llvm-gcc or heavily modified gcc 4.2)
from working properly, so we might as well enable support for that.

With this patch I was able to compile node using a manually compiled
gcc 4.7.1.

Closes #3887.

11 years agotimers: fix assertion in Timeout.unref()
Ben Noordhuis [Fri, 17 Aug 2012 12:11:33 +0000 (14:11 +0200)]
timers: fix assertion in Timeout.unref()

Ensure that the delay >= 0 when detaching the timer from the queue. Fixes the
following assertion:

  uv_timer_start: Assertion `timeout >= 0' failed.

No test included, it's timing sensitive.

11 years agotest: use common.PORT in simple/test-regress-GH-1697
Ben Noordhuis [Fri, 17 Aug 2012 12:03:01 +0000 (14:03 +0200)]
test: use common.PORT in simple/test-regress-GH-1697

11 years agotest: use common.PORT in pummel/test-net-timeout2
Ben Noordhuis [Fri, 17 Aug 2012 12:02:16 +0000 (14:02 +0200)]
test: use common.PORT in pummel/test-net-timeout2

11 years agotest: fix function name typo
Ben Noordhuis [Fri, 17 Aug 2012 11:44:25 +0000 (13:44 +0200)]
test: fix function name typo

It doesn't affect the semantics of the test because it checks if that
particular bit of code throws an exception. It does, only it's a SyntaxError.

11 years agoMerge remote-tracking branch 'origin/v0.8'
Ben Noordhuis [Fri, 17 Aug 2012 11:05:20 +0000 (13:05 +0200)]
Merge remote-tracking branch 'origin/v0.8'

Conflicts:
ChangeLog
src/node_version.h
test/message/stdin_messages.out
tools/install.py

11 years agowindows: make junctions work again
Bert Belder [Fri, 17 Aug 2012 00:30:57 +0000 (02:30 +0200)]
windows: make junctions work again

Closes GH-3879

11 years agoAvoid compiler warning about negating unsigned value
Bert Belder [Thu, 16 Aug 2012 23:08:06 +0000 (01:08 +0200)]
Avoid compiler warning about negating unsigned value

11 years agowindows: avoid MSVC warnings about templates not having a dll interface
Bert Belder [Thu, 16 Aug 2012 22:46:52 +0000 (00:46 +0200)]
windows: avoid MSVC warnings about templates not having a dll interface

11 years agowebsite: Improved install button behavior
isaacs [Thu, 16 Aug 2012 16:56:31 +0000 (09:56 -0700)]
website: Improved install button behavior

Just install whatever's best for the OS.

Detect host os and architecture from the navigator properties.  If we
can't make a good guess, then they get the tarball, and of course
everything we have is on the full download page.

11 years agov8: Reapply floating patches
isaacs [Tue, 24 Jul 2012 21:19:50 +0000 (14:19 -0700)]
v8: Reapply floating patches

11 years agov8: Upgrade to 3.11.10.18
isaacs [Thu, 16 Aug 2012 21:42:39 +0000 (14:42 -0700)]
v8: Upgrade to 3.11.10.18

11 years agoblog: Fix binary links for 0.8.7 post
isaacs [Thu, 16 Aug 2012 01:56:48 +0000 (18:56 -0700)]
blog: Fix binary links for 0.8.7 post

11 years agoemail-footer: update the binary package links to x86/x64
Nathan Rajlich [Thu, 16 Aug 2012 01:05:33 +0000 (18:05 -0700)]
email-footer: update the binary package links to x86/x64

11 years agowebsite: fix font-size on 'explore' list items
isaacs [Thu, 16 Aug 2012 00:33:03 +0000 (17:33 -0700)]
website: fix font-size on 'explore' list items

11 years agoNow working on 0.8.8
isaacs [Thu, 16 Aug 2012 00:25:25 +0000 (17:25 -0700)]
Now working on 0.8.8

11 years agoMerge branch 'v0.8.7-release' into v0.8
isaacs [Thu, 16 Aug 2012 00:25:01 +0000 (17:25 -0700)]
Merge branch 'v0.8.7-release' into v0.8

11 years agoblog: release 0.8.7
isaacs [Thu, 16 Aug 2012 00:23:59 +0000 (17:23 -0700)]
blog: release 0.8.7

11 years ago2012.08.15, Version 0.8.7 (Stable) v0.8.7
isaacs [Wed, 15 Aug 2012 16:20:56 +0000 (09:20 -0700)]
2012.08.15, Version 0.8.7 (Stable)

* npm: Upgrade to 1.1.49

* website: download page (Golo Roden)

* crypto: fix uninitialized memory access in openssl (Ben Noordhuis)

* buffer, crypto: fix buffer decoding (Ben Noordhuis)

* build: compile with -fno-tree-vrp when gcc >= 4.0 (Ben Noordhuis)

* tls: handle multiple CN fields when verifying cert (Ben Noordhuis)

* doc: remove unused util from child_process (Kyle Robinson Young)

* build: rework -fvisibility=hidden detection (Ben Noordhuis)

* windows: don't duplicate invalid stdio handles (Bert Belder)

* windows: fix typos in process-stdio.c (Bert Belder)

11 years agowebsite: Sharpen and clean up download page more
isaacs [Wed, 15 Aug 2012 22:47:52 +0000 (15:47 -0700)]
website: Sharpen and clean up download page more

Retinaify the images!

11 years agobuild: Don't set gcc_version for Windows
isaacs [Wed, 15 Aug 2012 18:28:52 +0000 (11:28 -0700)]
build: Don't set gcc_version for Windows

11 years agowebsite: Use table for download page
isaacs [Wed, 15 Aug 2012 15:33:35 +0000 (08:33 -0700)]
website: Use table for download page

Paragraphs of text are too wordy.

Use big pretty images and clickable blocky links.

11 years agowebsite: download page
Golo Roden [Mon, 13 Aug 2012 15:43:26 +0000 (17:43 +0200)]
website: download page

- Improved styling of download links.
- index.html#download now redirects to /download/
- Added missing hyphens, and added the missing "and 64-bit" for the Mac
  Installer.

11 years agonpm: Upgrade to 1.1.49
isaacs [Wed, 15 Aug 2012 03:27:28 +0000 (20:27 -0700)]
npm: Upgrade to 1.1.49

- node-gyp@0.6.5
- abstracted-out configs
- publishing over proxies
- bugfixes to all the deps

11 years agocrypto: fix uninitialized memory access in openssl
Ben Noordhuis [Wed, 15 Aug 2012 00:10:02 +0000 (02:10 +0200)]
crypto: fix uninitialized memory access in openssl

ASN1_STRING_to_UTF8() passes an ASN1_STRING to ASN1_STRING_set() but forgot to
initialize the `length` field.

Fixes the following valgrind error:

  $ valgrind -q --track-origins=yes --num-callers=19 \
      out/Debug/node test/simple/test-tls-client-abort.js
  ==2690== Conditional jump or move depends on uninitialised value(s)
  ==2690==    at 0x784B69: ASN1_STRING_set (asn1_lib.c:382)
  ==2690==    by 0x809564: ASN1_mbstring_ncopy (a_mbstr.c:204)
  ==2690==    by 0x8090F0: ASN1_mbstring_copy (a_mbstr.c:86)
  ==2690==    by 0x782F1F: ASN1_STRING_to_UTF8 (a_strex.c:570)
  ==2690==    by 0x78F090: asn1_string_canon (x_name.c:409)
  ==2690==    by 0x78EF17: x509_name_canon (x_name.c:354)
  ==2690==    by 0x78EA7D: x509_name_ex_d2i (x_name.c:210)
  ==2690==    by 0x788058: ASN1_item_ex_d2i (tasn_dec.c:239)
  ==2690==    by 0x7890D4: asn1_template_noexp_d2i (tasn_dec.c:746)
  ==2690==    by 0x788CB6: asn1_template_ex_d2i (tasn_dec.c:607)
  ==2690==    by 0x78877A: ASN1_item_ex_d2i (tasn_dec.c:448)
  ==2690==    by 0x7890D4: asn1_template_noexp_d2i (tasn_dec.c:746)
  ==2690==    by 0x788CB6: asn1_template_ex_d2i (tasn_dec.c:607)
  ==2690==    by 0x78877A: ASN1_item_ex_d2i (tasn_dec.c:448)
  ==2690==    by 0x787C93: ASN1_item_d2i (tasn_dec.c:136)
  ==2690==    by 0x78F5E4: d2i_X509 (x_x509.c:141)
  ==2690==    by 0x7C9B91: PEM_ASN1_read_bio (pem_oth.c:81)
  ==2690==    by 0x7CA506: PEM_read_bio_X509 (pem_x509.c:67)
  ==2690==    by 0x703C9A: node::crypto::SecureContext::AddRootCerts(v8::Arguments const&) (node_crypto.cc:497)
  ==2690==  Uninitialised value was created by a stack allocation
  ==2690==    at 0x782E89: ASN1_STRING_to_UTF8 (a_strex.c:560)

11 years agotest: fix up `make valgrind-test`
Ben Noordhuis [Tue, 14 Aug 2012 23:30:12 +0000 (01:30 +0200)]
test: fix up `make valgrind-test`

* valgrind complained too much about memory leaks from the V8 heap to be
  useful, run it with --leak-check=no. Not ideal, needs to be revisited,
  preferably with a suppression file.

* tools/run-valgrind.py didn't deal with tests that logged to stderr, rewrite
  the heuristic and make valgrind write to a socket instead of stderr.

Fixes #3869.

11 years agotest: raise pummel/test-net-throttle write req size
Ben Noordhuis [Wed, 8 Aug 2012 22:01:38 +0000 (00:01 +0200)]
test: raise pummel/test-net-throttle write req size

pummel/test-net-throttle assumes that a couple of big write requests result in
some of them getting queued because the kernel's send buffer fills up.

Said assumption breaks on systems with large send buffers. Raise the size of
the write request to ameliorate the issue.

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

11 years agoaddon: remove node-waf, superseded by node-gyp
Ben Noordhuis [Tue, 14 Aug 2012 21:06:32 +0000 (23:06 +0200)]
addon: remove node-waf, superseded by node-gyp

11 years agobuffer, crypto: fix buffer decoding
Ben Noordhuis [Tue, 14 Aug 2012 20:25:52 +0000 (22:25 +0200)]
buffer, crypto: fix buffer decoding

Before this commit, DecodeWrite() mistakenly tried to convert buffers to
UTF-8 strings which:

  a) produced invalid character sequences when the buffer contained
     octets > 127, and
  b) lead to spurious test failures because DecodeWrite() wrote less bytes
     than DecodeBytes() said it would, with the remainder either containing
     zeros or garbage

Fix that by simply copying the buffer's data to the target buffer when the
encoding is BINARY or by converting the buffer to a binary string when it's
UTF8 or ASCII.

Fixes #3651, #3866.

11 years agomodule: use 'repl' as the filename arg if missing
isaacs [Sun, 12 Aug 2012 01:58:40 +0000 (18:58 -0700)]
module: use 'repl' as the filename arg if missing

Fix #3859

11 years agoevents: emitter.listeners() should not have side effects
isaacs [Sat, 4 Aug 2012 20:32:18 +0000 (13:32 -0700)]
events: emitter.listeners() should not have side effects

Fixes #3803

11 years agobench: fetch port from env
jbergstroem [Mon, 14 Nov 2011 13:43:49 +0000 (14:43 +0100)]
bench: fetch port from env

http_simple.js honors $PORT, http_simple_bench.sh should too.

11 years agotls: fix segfault in pummel/test-tls-ci-reneg-attack
Ben Noordhuis [Mon, 13 Aug 2012 15:31:22 +0000 (17:31 +0200)]
tls: fix segfault in pummel/test-tls-ci-reneg-attack

Commit 4e5fe2d changed the way how process.nextTick() works:

    process.nextTick(function foo() {
      process.nextTick(function bar() {
        // ...
      });
    });

Before said commit, foo() and bar() used to run on separate event loop ticks
but that is no longer the case.

However, that's exactly the behavior that the TLS renegotiation attack guard
relies on. It gets called by OpenSSL and needs to defer the 'error' event to a
later tick because the default action is to destroy the TLS context - the same
context that OpenSSL currently operates on.

When things change underneath your feet, bad things happen and OpenSSL is no
exception. Ergo, use setImmediate() instead of process.nextTick() to ensure
that the 'error' event is actually emitted at a later tick.

Fixes #3840.

11 years agobuild: compile with -fno-tree-vrp when gcc >= 4.0
Ben Noordhuis [Mon, 13 Aug 2012 13:04:03 +0000 (15:04 +0200)]
build: compile with -fno-tree-vrp when gcc >= 4.0

11 years agodeps: upgrade libuv to 2c3e8b6
Ben Noordhuis [Mon, 13 Aug 2012 13:33:04 +0000 (15:33 +0200)]
deps: upgrade libuv to 2c3e8b6