platform/upstream/nodejs.git
11 years ago2013.07.09, Version 0.10.13 (Stable) upstream/0.10.13 v0.10.13
Timothy J Fontaine [Tue, 9 Jul 2013 20:32:22 +0000 (13:32 -0700)]
2013.07.09, Version 0.10.13 (Stable)

* uv: Upgrade to v0.10.12

* npm: Upgrade to 1.3.2

* windows: get proper errno (Ben Noordhuis)

* tls: only wait for finish if we haven't seen it (Timothy J Fontaine)

* http: Dump response when request is aborted (isaacs)

* http: use an unref'd timer to fix delay in exit (Peter Rust)

* zlib: level can be negative (Brian White)

* zlib: allow zero values for level and strategy (Brian White)

* buffer: add comment explaining buffer alignment (Ben Noordhuis)

* string_bytes: properly detect 64bit (Timothy J Fontaine)

* src: fix memory leak in UsingDomains() (Ben Noordhuis)

11 years agobuild: use separate env vars for signing
Timothy J Fontaine [Tue, 9 Jul 2013 20:48:24 +0000 (13:48 -0700)]
build: use separate env vars for signing

11 years agouv: Upgrade to v0.10.12
isaacs [Tue, 9 Jul 2013 20:20:38 +0000 (13:20 -0700)]
uv: Upgrade to v0.10.12

11 years agonpm: Upgrade to 1.3.2
isaacs [Tue, 9 Jul 2013 20:09:02 +0000 (13:09 -0700)]
npm: Upgrade to 1.3.2

11 years agotls: only wait for finish if we haven't seen it
Timothy J Fontaine [Sun, 23 Jun 2013 22:33:13 +0000 (22:33 +0000)]
tls: only wait for finish if we haven't seen it

A pooled https agent may get a Connection: close, but never finish
destroying the socket as the prior request had already emitted finish
likely from a pipe.

Since the socket is not marked as destroyed it may get reused by the
agent pool and result in an ECONNRESET.

re: #5712 #5739

11 years agodoc: fix bad markdown parsing in list
Nathan Rajlich [Mon, 8 Jul 2013 18:25:40 +0000 (11:25 -0700)]
doc: fix bad markdown parsing in list

11 years agohttp: Dump response when request is aborted
isaacs [Wed, 26 Jun 2013 16:13:48 +0000 (09:13 -0700)]
http: Dump response when request is aborted

Fixes #5695

11 years agodoc: remove obsolete spawn() stdio options
Tim Oxley [Fri, 5 Jul 2013 03:57:13 +0000 (11:57 +0800)]
doc: remove obsolete spawn() stdio options

11 years agosrc: fix memory leak in UsingDomains()
Ben Noordhuis [Fri, 5 Jul 2013 00:20:37 +0000 (02:20 +0200)]
src: fix memory leak in UsingDomains()

UsingDomains() assigned process_tickCallback when it had already
been set by MakeCallback() a few frames down the call stack.

Dispose the handle first or we'll retain whatever is in the lexical
closure of the old process._tickCallback function.

Fixes #5795.

11 years agotest: fix tls-hello-parser-failure on smartos
Timothy J Fontaine [Mon, 1 Jul 2013 21:29:15 +0000 (21:29 +0000)]
test: fix tls-hello-parser-failure on smartos

Assert that when the client closes it has seen an error, this prevents
the test from timing out.

Also queue a second write in the case that we were able to send the
buffer before the other side closed the connection.

11 years agohttp: use an unref'd timer to fix delay in exit
Peter Rust [Mon, 1 Jul 2013 22:46:49 +0000 (15:46 -0700)]
http: use an unref'd timer to fix delay in exit

There was previously up to a second exit delay when exiting node
right after an http request/response, due to the utcDate() function
doing a setTimeout to update the cached date/time.

Fixing this should increase the performance of our http tests.

11 years agozlib: level can be negative
Brian White [Mon, 1 Jul 2013 09:42:36 +0000 (05:42 -0400)]
zlib: level can be negative

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

11 years agozlib: allow zero values for level and strategy
Brian White [Mon, 1 Jul 2013 09:42:19 +0000 (05:42 -0400)]
zlib: allow zero values for level and strategy

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

11 years agodoc: vm: update github issues link
Ben Noordhuis [Fri, 28 Jun 2013 10:31:37 +0000 (12:31 +0200)]
doc: vm: update github issues link

11 years agobuffer: add comment explaining buffer alignment
Ben Noordhuis [Thu, 27 Jun 2013 01:18:41 +0000 (03:18 +0200)]
buffer: add comment explaining buffer alignment

Avoids alignment issues (unaligned loads/stores) on ARM. Originally
added in commit 285d8c6.

Fixes #3030.

11 years agoblog: v0.11.3 release
isaacs [Thu, 27 Jun 2013 00:06:40 +0000 (17:06 -0700)]
blog: v0.11.3 release

11 years agodoc: tls: ECDH ciphers are not supported
Ben Noordhuis [Wed, 26 Jun 2013 23:37:29 +0000 (01:37 +0200)]
doc: tls: ECDH ciphers are not supported

11 years agoRevert "configure: fix cross-compilation host_arch_cc()"
Ben Noordhuis [Tue, 25 Jun 2013 10:47:24 +0000 (12:47 +0200)]
Revert "configure: fix cross-compilation host_arch_cc()"

Several people have reported cross-compiling build breakage, see e.g.
https://groups.google.com/forum/#!topic/nodejs/k8HzqpqPkJQ

Message-Id: <823c3bd1-e104-4409-86ad-0ab6de936fec@googlegroups.com>
Subject: [nodejs] nodejs 0.10.12 and Angstrom issues

This reverts commit acbdabb74b1b8484671fd3c44cd9eb9a7ea11f41.

11 years agodoc: fs: synchronize watchFile/unwatchFile warning
Ben Noordhuis [Mon, 24 Jun 2013 09:16:48 +0000 (11:16 +0200)]
doc: fs: synchronize watchFile/unwatchFile warning

One said "if available", the other "if possible". Now they both say
"if possible."

11 years agostring_bytes: properly detect 64bit
Timothy J Fontaine [Thu, 20 Jun 2013 00:10:02 +0000 (17:10 -0700)]
string_bytes: properly detect 64bit

11 years agodoc: call console module 'console' not 'stdio'
Sam Roberts [Tue, 11 Jun 2013 23:49:56 +0000 (16:49 -0700)]
doc: call console module 'console' not 'stdio'

The console module has always been called 'stdio' in the
table-of-contents, but nowhere else, since its name is
'console'. This makes it difficult to find.

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

11 years agoblog: Release 0.10.12
isaacs [Tue, 18 Jun 2013 18:15:09 +0000 (11:15 -0700)]
blog: Release 0.10.12

11 years agoNow working on 0.10.13
isaacs [Tue, 18 Jun 2013 18:14:57 +0000 (11:14 -0700)]
Now working on 0.10.13

11 years agoMerge branch 'v0.10.12-release' into v0.10
isaacs [Tue, 18 Jun 2013 18:13:26 +0000 (11:13 -0700)]
Merge branch 'v0.10.12-release' into v0.10

11 years ago2013.06.18, Version 0.10.12 (Stable) v0.10.12
isaacs [Tue, 18 Jun 2013 16:50:53 +0000 (09:50 -0700)]
2013.06.18, Version 0.10.12 (Stable)

* npm: Upgrade to 1.2.32

* readline: make `ctrl + L` clear the screen (Yuan Chuan)

* v8: add setVariableValue debugger command (Ben Noordhuis)

* net: Do not destroy socket mid-write (isaacs)

* v8: fix build for mips32r2 architecture (Andrei Sedoi)

* configure: fix cross-compilation host_arch_cc() (Andrei Sedoi)

11 years agonpm: Upgrade to 1.2.32
isaacs [Tue, 18 Jun 2013 16:42:42 +0000 (09:42 -0700)]
npm: Upgrade to 1.2.32

11 years agoreadline: make `ctrl + L` clear the screen
Yuan Chuan [Sat, 15 Jun 2013 07:48:36 +0000 (15:48 +0800)]
readline: make `ctrl + L` clear the screen

11 years agov8: add setVariableValue debugger command
Ben Noordhuis [Mon, 3 Dec 2012 20:29:29 +0000 (20:29 +0000)]
v8: add setVariableValue debugger command

Issue 2399 part 1: In debugger allow modifying local variable values
Issue 2399 part 2: In debugger allow modifying local variable values

Review URL: https://codereview.chromium.org/11415042
Review URL: https://codereview.chromium.org/11412310

This is a back-port of upstream svn commits r13122 and r13202.

11 years agonet: Do not destroy socket mid-write
isaacs [Fri, 14 Jun 2013 22:57:11 +0000 (15:57 -0700)]
net: Do not destroy socket mid-write

The fix in e0519ace315c7ce14278d5eaab8d1d72a0a0a054 is overly zealous,
and can destroy a socket while there are still outstanding writes in
progress.

Closes GH-5688

11 years agotest: add https tls session reuse test
Ben Noordhuis [Sat, 15 Jun 2013 18:33:17 +0000 (20:33 +0200)]
test: add https tls session reuse test

Check that TLS session resumptions work with HTTPS servers.

Regression test for #3901.

11 years agoblog: Add favicon to blog site
isaacs [Fri, 14 Jun 2013 17:26:15 +0000 (10:26 -0700)]
blog: Add favicon to blog site

11 years agodoc: Remove unnecessary sh script tags
isaacs [Fri, 14 Jun 2013 17:25:47 +0000 (10:25 -0700)]
doc: Remove unnecessary sh script tags

11 years agov8: fix build for mips32r2 architecture
Andrei Sedoi [Fri, 14 Jun 2013 14:48:49 +0000 (17:48 +0300)]
v8: fix build for mips32r2 architecture

This is a floating patch as a backport from v8 3.15.0
Committed: https://code.google.com/p/v8/source/detail?r=12833

11 years agoconfigure: fix cross-compilation host_arch_cc()
Andrei Sedoi [Fri, 14 Jun 2013 12:49:14 +0000 (15:49 +0300)]
configure: fix cross-compilation host_arch_cc()

In case of cross-compilation host_arch_cc() function could return
target arch if CC was set to target arch compiler. Host arch
compiler should always be used in this case. This was broken
by commit 707863c.

11 years agodoc: v0.8.25 changelog entry
isaacs [Thu, 13 Jun 2013 20:22:46 +0000 (13:22 -0700)]
doc: v0.8.25 changelog entry

11 years agoblog: Release v0.8.25
isaacs [Thu, 13 Jun 2013 20:22:07 +0000 (13:22 -0700)]
blog: Release v0.8.25

11 years agoblog: Release 0.10.11
isaacs [Thu, 13 Jun 2013 18:37:18 +0000 (11:37 -0700)]
blog: Release 0.10.11

11 years agoNow working on 0.10.12
isaacs [Thu, 13 Jun 2013 18:37:04 +0000 (11:37 -0700)]
Now working on 0.10.12

11 years agoMerge branch 'v0.10.11-release' into v0.10
isaacs [Thu, 13 Jun 2013 18:36:41 +0000 (11:36 -0700)]
Merge branch 'v0.10.11-release' into v0.10

11 years ago2013.06.13, Version 0.10.11 (Stable) v0.10.11
isaacs [Thu, 13 Jun 2013 17:35:30 +0000 (10:35 -0700)]
2013.06.13, Version 0.10.11 (Stable)

* uv: upgrade to 0.10.11

* npm: Upgrade to 1.2.30

* openssl: add missing configuration pieces for MIPS (Andrei Sedoi)

* Revert "http: remove bodyHead from 'upgrade' events" (isaacs)

* v8: fix pointer arithmetic undefined behavior (Trevor Norris)

* crypto: fix utf8/utf-8 encoding check (Ben Noordhuis)

* net: Fix busy loop on POLLERR|POLLHUP on older linux kernels (Ben Noordhuis, isaacs)

11 years agotest: minor typo fixes
Veres Lajos [Wed, 12 Jun 2013 22:51:17 +0000 (23:51 +0100)]
test: minor typo fixes

11 years agoopenssl: add missing configuration pieces for MIPS
Andrei Sedoi [Wed, 12 Jun 2013 15:47:10 +0000 (18:47 +0300)]
openssl: add missing configuration pieces for MIPS

11 years agoRevert "http: remove bodyHead from 'upgrade' events"
isaacs [Thu, 13 Jun 2013 00:45:30 +0000 (17:45 -0700)]
Revert "http: remove bodyHead from 'upgrade' events"

This reverts commit a40133d10cdb911b27fe8d46d67a835b0103bbf1.

Unfortunately, this breaks socket.io.  Even though it's not strictly an
API change, it is too subtle and in too brittle an area of node, to be
done in a stable branch.

Conflicts:
doc/api/http.markdown

11 years agouv: upgrade to 0.10.11
Ben Noordhuis [Wed, 12 Jun 2013 20:10:39 +0000 (22:10 +0200)]
uv: upgrade to 0.10.11

11 years agonpm: Upgrade to 1.2.30
isaacs [Wed, 12 Jun 2013 17:59:44 +0000 (10:59 -0700)]
npm: Upgrade to 1.2.30

11 years agov8: fix pointer arithmetic undefined behavior
Trevor Norris [Tue, 11 Jun 2013 21:39:25 +0000 (14:39 -0700)]
v8: fix pointer arithmetic undefined behavior

Clang branch release_33 would optimize out a != NULL check because of
some undefined behavior. This is a floating patch as a backport of that
fix.

Committed: http://code.google.com/p/v8/source/detail?r=13570

11 years agocrypto: fix utf8/utf-8 encoding check
Ben Noordhuis [Mon, 10 Jun 2013 21:34:11 +0000 (23:34 +0200)]
crypto: fix utf8/utf-8 encoding check

Normalize the encoding in getEncoding() before using it. Fixes a
"AssertionError: Cannot change encoding" exception when the caller
mixes "utf8" and "utf-8".

Fixes #5655.

11 years agobuild: add pkgsrc rule
Timothy J Fontaine [Tue, 4 Jun 2013 00:05:56 +0000 (17:05 -0700)]
build: add pkgsrc rule

11 years agonpm: Upgrade to 1.2.27
isaacs [Thu, 6 Jun 2013 21:44:48 +0000 (14:44 -0700)]
npm: Upgrade to 1.2.27

11 years agonet: Destroy when not readable and not writable
isaacs [Wed, 5 Jun 2013 06:43:29 +0000 (23:43 -0700)]
net: Destroy when not readable and not writable

This is only relevant for CentOS 6.3 using kernel version 2.6.32.

On other linuxes and darwin, the `read` call gets an ECONNRESET in that
case.  On sunos, the `write` call fails with EPIPE.

However, old CentOS will occasionally send an EOF instead of a
ECONNRESET or EPIPE when the client has been destroyed abruptly.

Make sure we don't keep trying to write or read more in that case.

Fixes #5504

However, there is still the question of what libuv should do when it
gets an EOF.  Apparently in this case, it will continue trying to read,
which is almost certainly the wrong thing to do.

That should be fixed in libuv, even though this works around the issue.

11 years agoNow working on v0.10.11
isaacs [Tue, 4 Jun 2013 21:38:41 +0000 (14:38 -0700)]
Now working on v0.10.11

11 years agoblog: Release v0.10.10
isaacs [Tue, 4 Jun 2013 21:38:29 +0000 (14:38 -0700)]
blog: Release v0.10.10

11 years agoMerge branch 'v0.10.10-release' into v0.10
isaacs [Tue, 4 Jun 2013 21:38:10 +0000 (14:38 -0700)]
Merge branch 'v0.10.10-release' into v0.10

11 years ago2013.06.04, Version 0.10.10 (Stable) v0.10.10
isaacs [Tue, 4 Jun 2013 19:13:46 +0000 (12:13 -0700)]
2013.06.04, Version 0.10.10 (Stable)

* uv: Upgrade to 0.10.10

* npm: Upgrade to 1.2.25

* url: Properly parse certain oddly formed urls (isaacs)

* stream: unshift('') is a noop (isaacs)

11 years agouv: Upgrade to 0.10.10
isaacs [Tue, 4 Jun 2013 19:11:03 +0000 (12:11 -0700)]
uv: Upgrade to 0.10.10

11 years agourl: remove unused global variable
Ben Noordhuis [Tue, 21 May 2013 21:04:58 +0000 (23:04 +0200)]
url: remove unused global variable

11 years agonpm: Upgrade to 1.2.25
isaacs [Tue, 4 Jun 2013 18:42:32 +0000 (11:42 -0700)]
npm: Upgrade to 1.2.25

11 years agodoc: ChangeLog update for v0.8.24
isaacs [Tue, 4 Jun 2013 18:22:14 +0000 (11:22 -0700)]
doc: ChangeLog update for v0.8.24

11 years agoblog: 0.8 is maintenace, not stable
isaacs [Tue, 4 Jun 2013 18:19:10 +0000 (11:19 -0700)]
blog: 0.8 is maintenace, not stable

11 years agoblog: Release v0.8.24
isaacs [Tue, 4 Jun 2013 18:12:54 +0000 (11:12 -0700)]
blog: Release v0.8.24

11 years agoblog: Release v0.10.9
isaacs [Tue, 4 Jun 2013 18:12:44 +0000 (11:12 -0700)]
blog: Release v0.10.9

11 years agourl: Set href to null by default
isaacs [Mon, 3 Jun 2013 23:02:51 +0000 (16:02 -0700)]
url: Set href to null by default

11 years agourl: Properly parse certain oddly formed urls
isaacs [Mon, 3 Jun 2013 20:39:57 +0000 (13:39 -0700)]
url: Properly parse certain oddly formed urls

In cases where there are multiple @-chars in a url, Node currently
parses the hostname and auth sections differently than web browsers.

This part of the bug is serious, and should be landed in v0.10, and
also ported to v0.8, and releases made as soon as possible.

The less serious issue is that there are many other sorts of malformed
urls which Node either accepts when it should reject, or interprets
differently than web browsers.  For example, `http://a.com*foo` is
interpreted by Node like `http://a.com/*foo` when web browsers treat
this as `http://a.com%3Bfoo/`.

In general, *only* the `hostEndingChars` should be the characters that
delimit the host portion of the URL.  Most of the current `nonHostChars`
that appear in the hostname should be escaped, but some of them (such as
`;` and `%` when it does not introduce a hex pair) should raise an
error.

We need to have a broader discussion about whether it's best to throw in
these cases, and potentially break extant programs, or return an object
that has every field set to `null` so that any attempt to read the
hostname/auth/etc. will appear to be empty.

11 years agostream: unshift('') is a noop
isaacs [Mon, 3 Jun 2013 17:50:02 +0000 (10:50 -0700)]
stream: unshift('') is a noop

In some cases, the http CONNECT/Upgrade API is unshifting an empty
bodyHead buffer onto the socket.

Normally, stream.unshift(chunk) does not set state.reading=false.
However, this check was not being done for the case when the chunk was
empty (either `''` or `Buffer(0)`), and as a result, it was causing the
socket to think that a read had completed, and to stop providing data.

This bug is not limited to http or web sockets, but rather would affect
any parser that unshifts data back onto the source stream without being
very careful to never unshift an empty chunk.  Since the intent of
unshift is to *not* change the state.reading property, this is a bug.

Fixes #5557
Fixes LearnBoost/socket.io#1242

11 years agoNow working on v0.10.10
isaacs [Thu, 30 May 2013 18:28:07 +0000 (11:28 -0700)]
Now working on v0.10.10

11 years agoMerge branch 'v0.10.9-release' into v0.10
isaacs [Thu, 30 May 2013 18:27:50 +0000 (11:27 -0700)]
Merge branch 'v0.10.9-release' into v0.10

11 years ago2013.05.30, Version 0.10.9 (Stable) v0.10.9
isaacs [Thu, 30 May 2013 17:31:07 +0000 (10:31 -0700)]
2013.05.30, Version 0.10.9 (Stable)

* npm: Upgrade to 1.2.24

* uv: Upgrade to v0.10.9

* repl: fix JSON.parse error check (Brian White)

* tls: proper .destroySoon (Fedor Indutny)

* tls: invoke write cb only after opposite read end (Fedor Indutny)

* tls: ignore .shutdown() syscall error (Fedor Indutny)

11 years agonpm: Upgrade to 1.2.24
isaacs [Thu, 30 May 2013 17:19:45 +0000 (10:19 -0700)]
npm: Upgrade to 1.2.24

11 years agodoc: remove `bufferSize` option
Kiyoshi Nomo [Wed, 22 May 2013 14:22:21 +0000 (23:22 +0900)]
doc: remove `bufferSize` option

`bufferSize` option has been removed in b0f6789.

11 years agorepl: fix JSON.parse error check
Brian White [Sun, 26 May 2013 16:26:39 +0000 (12:26 -0400)]
repl: fix JSON.parse error check

Before this, entering something like:

> JSON.parse('066');

resulted in the "..." prompt instead of displaying the expected
"SyntaxError: Unexpected number"

11 years agotls: proper .destroySoon
Fedor Indutny [Thu, 30 May 2013 09:35:24 +0000 (13:35 +0400)]
tls: proper .destroySoon

1. Emit `sslOutEnd` only when `_internallyPendingBytes() === 0`.
2. Read before checking `._halfRead`, otherwise we'll see only previous
   value, and will invoke `._write` callback improperly.
3. Wait for both `end` and `finish` events in `.destroySoon`.
4. Unpipe encrypted stream from socket to prevent write after destroy.

11 years agodoc: sending dgram handles only works on unix
Ben Noordhuis [Wed, 29 May 2013 14:35:00 +0000 (16:35 +0200)]
doc: sending dgram handles only works on unix

11 years agohttps: Add `secureProtocol` docs
Daniel G. Taylor [Wed, 15 May 2013 19:16:09 +0000 (13:16 -0600)]
https: Add `secureProtocol` docs

Add `secureProtocol` parameter docs to the https.request method.

11 years agotls: Add `secureProtocol` docs
Daniel G. Taylor [Wed, 15 May 2013 19:14:20 +0000 (13:14 -0600)]
tls: Add `secureProtocol` docs

Add `secureProtocol` parameter docs to the tls.connect method.

11 years agouv: Upgrade to v0.10.9
isaacs [Tue, 28 May 2013 19:10:14 +0000 (12:10 -0700)]
uv: Upgrade to v0.10.9

11 years agotls: invoke write cb only after opposite read end
Fedor Indutny [Mon, 27 May 2013 10:44:33 +0000 (14:44 +0400)]
tls: invoke write cb only after opposite read end

Stream's `._write()` callback should be invoked only after it's opposite
stream has finished processing incoming data, otherwise `finish` event
fires too early and connection might be closed while there's some data
to send to the client.

see #5544

11 years agotls: ignore .shutdown() syscall error
Fedor Indutny [Tue, 28 May 2013 13:50:38 +0000 (17:50 +0400)]
tls: ignore .shutdown() syscall error

Quote from SSL_shutdown man page:

  The output of SSL_get_error(3) may be misleading,
  as an erroneous SSL_ERROR_SYSCALL may be flagged even though
  no error occurred.

Also, handle all other errors to prevent assertion in `ClearError()`.

11 years agodoc: add link to Brazilian Node community
Rafael Henrique Moreira [Sat, 25 May 2013 03:49:49 +0000 (03:49 +0000)]
doc: add link to Brazilian Node community

Add a link to the Brazilian community portal.

11 years agodoc: remove broken links on community page
Rafael Henrique Moreira [Sat, 25 May 2013 04:01:25 +0000 (04:01 +0000)]
doc: remove broken links on community page

Links to Node Manual and Node Bits both are broken, so this commit
removes them from the community page.

11 years agoblog: Post for v0.10.8
isaacs [Fri, 24 May 2013 22:45:59 +0000 (15:45 -0700)]
blog: Post for v0.10.8

11 years agoNow working on 0.10.9
isaacs [Fri, 24 May 2013 22:45:46 +0000 (15:45 -0700)]
Now working on 0.10.9

11 years agoMerge branch 'v0.10.8-release' into v0.10
isaacs [Fri, 24 May 2013 22:44:04 +0000 (15:44 -0700)]
Merge branch 'v0.10.8-release' into v0.10

11 years ago2013.05.24, Version 0.10.8 (Stable) v0.10.8
isaacs [Fri, 24 May 2013 21:45:24 +0000 (14:45 -0700)]
2013.05.24, Version 0.10.8 (Stable)

* v8: update to 3.14.5.9

* uv: upgrade to 0.10.8

* npm: Upgrade to 1.2.23

* http: remove bodyHead from 'upgrade' events (Nathan Zadoks)

* http: Return true on empty writes, not false (isaacs)

* http: save roundtrips, convert buffers to strings (Ben Noordhuis)

* configure: respect the --dest-os flag consistently (Nathan Rajlich)

* buffer: throw when writing beyond buffer (Trevor Norris)

* crypto: Clear error after DiffieHellman key errors (isaacs)

* string_bytes: strip padding from base64 strings (Trevor Norris)

11 years agodoc: Minor fixup in http doc re bodyHead
isaacs [Fri, 24 May 2013 22:06:03 +0000 (15:06 -0700)]
doc: Minor fixup in http doc re bodyHead

11 years agotls: retry writing after hello parse error
Fedor Indutny [Fri, 24 May 2013 21:02:34 +0000 (01:02 +0400)]
tls: retry writing after hello parse error

When writing bad data to EncryptedStream it'll first get to the
ClientHello parser, and, only after it will refuse it, to the OpenSSL.
But ClientHello parser has limited buffer and therefore write could
return `bytes_written` < `incoming_bytes`, which is not the case when
working with OpenSSL.

After such errors ClientHello parser disables itself and will
pass-through all data to the OpenSSL. So just trying to write data one
more time will throw the rest into OpenSSL and let it handle it.

11 years agonpm: Upgrade to 1.2.23
isaacs [Fri, 24 May 2013 21:41:43 +0000 (14:41 -0700)]
npm: Upgrade to 1.2.23

11 years agouv: upgrade to 0.10.8
isaacs [Fri, 24 May 2013 21:41:00 +0000 (14:41 -0700)]
uv: upgrade to 0.10.8

11 years agohttp: remove bodyHead from 'upgrade' events
Nathan Zadoks [Fri, 24 May 2013 17:34:38 +0000 (19:34 +0200)]
http: remove bodyHead from 'upgrade' events

Streams2 makes this unnecessary.
An empty buffer is provided for compatibility.

11 years agobuffer: special case empty string writes
Timothy J Fontaine [Thu, 23 May 2013 23:23:07 +0000 (16:23 -0700)]
buffer: special case empty string writes

Prior to 119354f we specifically handled passing a zero length string
to write on a buffer, restore that functionality.

11 years agohttp: Return true on empty writes, not false
isaacs [Thu, 23 May 2013 22:12:13 +0000 (15:12 -0700)]
http: Return true on empty writes, not false

Otherwise, writing an empty string causes the whole program to grind to
a halt when piping data into http messages.

This wasn't as much of a problem (though it WAS a bug) in 0.8 and
before, because our hyperactive 'drain' behavior would mean that some
*previous* write() would probably have a pending drain event, and cause
things to start moving again.

11 years agov8: re-apply floating patches
Timothy J Fontaine [Thu, 23 May 2013 20:40:40 +0000 (13:40 -0700)]
v8: re-apply floating patches

11 years agov8: fix GetLocalizedMessage usage
Timothy J Fontaine [Thu, 23 May 2013 20:57:59 +0000 (13:57 -0700)]
v8: fix GetLocalizedMessage usage

As is the backport of the abort on uncaught exception wouldn't compile
because we it was passing in `this` when it was unnecessary.

11 years agov8: update to 3.14.5.9
Timothy J Fontaine [Thu, 23 May 2013 20:39:12 +0000 (13:39 -0700)]
v8: update to 3.14.5.9

11 years agohttp: save roundtrips, convert buffers to strings
Ben Noordhuis [Wed, 22 May 2013 19:43:35 +0000 (21:43 +0200)]
http: save roundtrips, convert buffers to strings

This commit adds an optimization to the HTTP client that makes it
possible to:

* Pack the headers and the first chunk of the request body into a
  single write().

* Pack the chunk header and the chunk itself into a single write().

Because only one write() system call is issued instead of several,
the chances of data ending up in a single TCP packet are phenomenally
higher: the benchmark with `type=buf size=32` jumps from 50 req/s to
7,500 req/s, a 150-fold increase.

This commit removes the check from e4b716ef that pushes binary encoded
strings into the slow path. The commit log mentions that:

    We were assuming that any string can be concatenated safely to
    CRLF.  However, for hex, base64, or binary encoded writes, this
    is not the case, and results in sending the incorrect response.

For hex and base64 strings that's certainly true but binary strings
are 'das Ding an sich': string.length is the same before and after
decoding.

Fixes #5528.

11 years agodoc: the build requires gcc 4.2 or newer
Ben Noordhuis [Wed, 22 May 2013 11:47:29 +0000 (13:47 +0200)]
doc: the build requires gcc 4.2 or newer

11 years agoconfigure: respect the --dest-os flag consistently
Nathan Rajlich [Tue, 21 May 2013 16:26:42 +0000 (09:26 -0700)]
configure: respect the --dest-os flag consistently

Consider a user on his Mac, who wants to cross-compile for his Linux ARM device:

    ./configure --dest-cpu=arm --dest-os=linux

Before this patch, for example, DTrace probes would incorrectly attempt to be
enabled because the configure script is running on a MacOS machine, even though
we're trying to compile a binary for `linux`.

With this patch, the `--dest-os` flag is respected throughout the configure
script, thus leaving DTrace probes disabled in this cross-compiling scenario.

11 years agonet: use timers._unrefActive for internal timeouts
Timothy J Fontaine [Fri, 17 May 2013 22:07:28 +0000 (15:07 -0700)]
net: use timers._unrefActive for internal timeouts

11 years agotimers: internal unref'd timer for api timeouts
Timothy J Fontaine [Fri, 17 May 2013 22:04:24 +0000 (15:04 -0700)]
timers: internal unref'd timer for api timeouts

When an internal api needs a timeout, they should use
timers._unrefActive since that won't hold the loop open. This solves
the problem where you might have unref'd the socket handle but the
timeout for the socket was still active.

11 years agobuffer: throw when writing beyond buffer
Trevor Norris [Mon, 20 May 2013 21:37:55 +0000 (14:37 -0700)]
buffer: throw when writing beyond buffer

Previously one could write anywhere in a buffer pool if they accidently
got their offset wrong. Mainly because the cc level checks only test
against the parent slow buffer and not against the js object properties.
So now we check to make sure values won't go beyond bounds without
letting the dev know.

11 years agocrypto: Clear error after DiffieHellman key errors
isaacs [Sat, 18 May 2013 00:19:12 +0000 (17:19 -0700)]
crypto: Clear error after DiffieHellman key errors

Fixes #5499