Commit Graph

8261 Commits (e5fdc4d6f1af4417ef9bb4ca7050fd633ea09267)

Author SHA1 Message Date
isaacs 1d17ced200 blog: v0.11.0 release 2013-03-28 14:53:29 -07:00
isaacs f1fa756681 blog: Update linux binary tarball shasums
I just accidentally the binary release.
2013-03-28 14:39:52 -07:00
isaacs 708e8589ea blog: Post about v0.10.2 2013-03-28 13:06:24 -07:00
isaacs 61d254ebdc Node working on 0.10.3 2013-03-28 13:06:24 -07:00
isaacs 8106dc3624 Merge branch 'v0.10.2-release' into v0.10 2013-03-28 13:05:37 -07:00
Ben Noordhuis 902d6cb6d7 src: tie process.versions.uv to uv_version_string() 2013-03-28 20:12:05 +01:00
isaacs 1e0de9c426 2013.03.28, Version 0.10.2 (Stable)
* npm: Upgrade to 1.2.15

* uv: Upgrade to 0.10.3

* tls: handle SSL_ERROR_ZERO_RETURN (Fedor Indutny)

* tls: handle errors before calling C++ methods (Fedor Indutny)

* tls: remove harmful unnecessary bounds checking (Marcel Laverdet)

* crypto: make getCiphers() return non-SSL ciphers (Ben Noordhuis)

* crypto: check randomBytes() size argument (Ben Noordhuis)

* timers: do not calculate Timeout._when property (Alexey Kupershtokh)

* timers: fix off-by-one ms error (Alexey Kupershtokh)

* timers: handle signed int32 overflow in enroll() (Fedor Indutny)

* stream: Fix stall in Transform under very specific conditions (Gil Pedersen)

* stream: Handle late 'readable' event listeners (isaacs)

* stream: Fix early end in Writables on zero-length writes (isaacs)

* domain: fix domain callback from MakeCallback (Trevor Norris)

* child_process: don't emit same handle twice (Ben Noordhuis)

* child_process: fix sending utf-8 to child process (Ben Noordhuis)
2013-03-28 12:07:52 -07:00
Bert Belder 1b5ec033ee deps: upgrade libuv to v0.10.3 2013-03-28 20:05:33 +01:00
isaacs dea0634f60 npm: Upgrade to v1.2.15 2013-03-28 11:35:12 -07:00
Fedor Indutny 4580be0882 tls: handle SSL_ERROR_ZERO_RETURN
see #5004
2013-03-28 21:59:19 +04:00
wicked 39058bef07 setTimeout: do not calculate Timeout._when property
Dramatically improves Timer performance.
2013-03-28 10:40:15 -07:00
isaacs 929e4d9c9a stream: Emit readable on ended streams via read(0)
cc: @mjijackson
2013-03-28 10:27:18 -07:00
isaacs eafa902632 stream: Handle late 'readable' event listeners
In cases where a stream may have data added to the read queue before the
user adds a 'readable' event, there is never any indication that it's
time to start reading.

True, there's already data there, which the user would get if they
checked However, as we use 'readable' event listening as the signal to
start the flow of data with a read(0) call internally, we ought to
trigger the same effect (ie, emitting a 'readable' event) even if the
'readable' listener is added after the first emission.

To avoid confusing weirdness, only the *first* 'readable' event listener
is granted this privileged status.  After we've started the flow (or,
alerted the consumer that the flow has started) we don't need to start
it again.  At that point, it's the consumer's responsibility to consume
the stream.

Closes #5141
2013-03-28 10:27:18 -07:00
isaacs 5ae26f3750 doc: Add 'don't ignore errors' section to domain
Also, an example program of using cluster and domain to handle errors
safely, with zero downtime, using process isolation.
2013-03-28 09:53:59 -07:00
Benjamin Ruston 024a8b0cb4 doc: debugger, dns, http: fix grammar 2013-03-28 16:50:37 +01:00
Ben Noordhuis 982877ec85 deps: upgrade libuv to 7514149 2013-03-28 00:28:45 +01:00
isaacs 61935bc167 test: Accept either kind of NaN
A llvm/clang bug on Darwin ia32 makes these tests fail 100% of
the time.  Since no one really seems to mind overly much, and we
can't reasonably fix this in node anyway, just accept both types
of NaN for now.
2013-03-27 09:47:16 -07:00
Fedor Indutny ae86fa84fe tls: handle errors before calling C++ methods
Calling `this.pair.encrypted._internallyPendingBytes()` before
handling/resetting error will result in assertion failure:

../src/node_crypto.cc:962: void node::crypto::Connection::ClearError():
Assertion `handle_->Get(String::New("error"))->BooleanValue() == false'
failed.

see #5058
2013-03-27 16:26:24 +04:00
Benjamin Ruston 372911ffc7 doc: addon: fix grammar 2013-03-27 12:37:54 +01:00
Fedor Indutny 28c6e42ee7 openssl: disable HEARTBEAT TLS extension
Microsoft's IIS doesn't support it, and is not replying with ServerHello
after receiving ClientHello which contains it.

The good way might be allowing to opt-out this at runtime from
javascript-land, but unfortunately OpenSSL doesn't support it right now.

see #5119
2013-03-27 11:41:23 +04:00
Trevor Norris f0b68892d4 domain: fix domain callback from MakeCallback
Since _tickCallback and _tickDomainCallback were both called from
MakeCallback, it was possible for a callback to be called that required
a domain directly to _tickCallback.

The fix was to implement process.usingDomains(). This will set all
applicable functions to their domain counterparts, and set a flag in cc
to let MakeCallback know domain callbacks always need to be checked.

Added test in own file. It's important that the test remains isolated.
2013-03-26 21:26:17 -07:00
Ben Noordhuis a80a132b38 doc: child_process: document 'error' event
Fixes #5130.
2013-03-26 16:34:43 +01:00
Ben Noordhuis 0e08e147c7 doc: fix formatting in tty.markdown
Fixes #5135.
2013-03-26 16:09:51 +01:00
Timothy J Fontaine fb6dd0c0b5 test: test name is the last elem, not second
When a test requires node to have parameters passed (--expose-gc) the
test name will be the last element in the command array, not the second.
2013-03-26 00:21:41 +01:00
Ben Noordhuis 9352c19885 child_process: don't emit same handle twice
It's possible to read multiple messages off the parent/child channel.
When that happens, make sure that recvHandle is cleared after emitting
the first message so it doesn't get emitted twice.
2013-03-25 23:07:30 +01:00
Ben Noordhuis cfd0dca9ae crypto: make getCiphers() return non-SSL ciphers
Commit f53441a added crypto.getCiphers() as a function that returns the
names of SSL ciphers.

Commit 14a6c4e then added crypto.getHashes(), which returns the names of
digest algorithms, but that creates a subtle inconsistency: the return
values of crypto.getHashes() are valid arguments to crypto.createHash()
but that is not true for crypto.getCiphers() - the returned values are
only valid for SSL/TLS functions.

Rectify that by adding tls.getCiphers() and making crypto.getCiphers()
return proper cipher names.
2013-03-25 18:42:07 +01:00
Mathias Bynens 488b74d68b doc: mention `process.*.isTTY` under `process` 2013-03-25 13:54:32 +01:00
Ben Noordhuis 44843a6062 child_process: fix sending utf-8 to child process
In process#send() and child_process.ChildProcess#send(), use 'utf8' as
the encoding instead of 'ascii' because 'ascii' mutilates non-ASCII
input. Correctly handle partial character sequences by introducing
a StringDecoder.

Sending over UTF-8 no longer works in v0.10 because the high bit of
each byte is now cleared when converting a Buffer to ASCII. See
commit 96a314b for details.

Fixes #4999 and #5011.
2013-03-25 13:23:17 +01:00
Ben Noordhuis 05bd6b7bcd bench: add child process read perf benchmark 2013-03-25 13:16:07 +01:00
Ben Noordhuis 690a8cce41 deps: fix openssl build on windows
Commit 8632af3 ("tools: update gyp to r1601") broke the Windows build.

Older versions of GYP link to kernel32.lib, user32.lib, etc. but that
was changed in r1584. See https://codereview.chromium.org/12256017

Fix the build by explicitly linking to the required libraries.
2013-03-24 22:53:11 +01:00
isaacs c0d500102a stream: Fix early end in Writables on zero-length writes
Doing this causes problems:

    z.write(Buffer(0));
    z.end();

Fix by not ending Writable streams while they're still in the process of
writing something.
2013-03-24 14:23:21 -07:00
Ben Noordhuis 8632af381e tools: update gyp to r1601
Among other things, this should make it easier for people to build
node.js on openbsd.
2013-03-24 15:03:09 +01:00
Ben Noordhuis 329b5388ba doc: update CONTRIBUTING.md
* Latest stable is v0.10 now.
* Add example of what the first line of the commit log should look like.
2013-03-24 13:28:46 +01:00
Alexey Kupershtokh 9fae4dc102 timer: fix off-by-one ms error
Fix #5103
2013-03-23 18:46:14 -07:00
Marcel Laverdet 1526909083 tls: remove harmful unnecessary bounds checking
The EncIn, EncOut, ClearIn & ClearOut functions are victims of some code
copy + pasting. A common line copied to all of them is:

`if (off >= buffer_length) { ...`

448e0f43 corrected ClearIn's check from `>=` to `>`, but left the others
unchanged (with an incorrect bounds check). However, if you look down at
the next very next bounds check you'll see:

`if (off + len > buffer_length) { ...`

So the check is actually obviated by the next line, and should be
removed.

This fixes an issue where writing a zero-length buffer to an encrypted
pair's *encrypted* stream you would get a crash.
2013-03-24 00:04:34 +07:00
verwaest@chromium.org 14417fdb3f v8: Unify kMaxArguments with number of bits used to encode it.
Increase the number of bits by 1 by making Flags unsigned.

BUG=chromium:211741

Review URL: https://chromiumcodereview.appspot.com/12886008

This is a back-port of commits 13964 and 13988 addressing CVE-2013-2632.
2013-03-23 17:14:28 +01:00
Ben Noordhuis 628bd81afb crypto: check randomBytes() size argument
Throw a TypeError if size > 0x3fffffff. Avoids the following V8 fatal
error:

  FATAL ERROR: v8::Object::SetIndexedPropertiesToExternalArrayData()
  length exceeds max acceptable value

Fixes #5126.
2013-03-23 15:50:10 +01:00
Ben Noordhuis 132c77e9f9 doc: document that stdio is usually blocking 2013-03-23 15:38:17 +01:00
Gil Pedersen c3aae9cf95 stream: Fix stall in Transform under very specific conditions
The stall is exposed in the test, though the test itself asserts before
it stalls.

The test is constructed to replicate the stalling state of a complex
Passthrough usecase since I was not able to reliable trigger the stall.

Some of the preconditions for triggering the stall are:
  * rs.length >= rs.highWaterMark
  * !rs.needReadable
  * _transform() handler that can return empty transforms
  * multiple sync write() calls

Combined this can trigger a case where rs.reading is not cleared when
further progress requires this. The fix is to always clear rs.reading.
2013-03-21 17:49:12 -07:00
Fedor Indutny bfd16de125 timers: handle signed int32 overflow in enroll()
Before this patch calling `socket.setTimeout(0xffffffff)` will result in
signed int32 overflow in C++ which resulted in assertion error:

    Assertion failed: (timeout >= -1), function uv__io_poll, file
    ../deps/uv/src/unix/kqueue.c, line 121.

see #5101
2013-03-21 22:09:05 +04:00
isaacs 92cc187881 blog: Post for v0.10.1 2013-03-21 09:14:39 -07:00
isaacs 9d3a09f9a8 Now working on v0.10.2 2013-03-21 09:14:31 -07:00
isaacs 41405f4703 Merge branch 'v0.10.1-release' into v0.10 2013-03-21 09:13:45 -07:00
Ben Noordhuis e47a3e3ff4 deps: upgrade libuv to 9b61939 2013-03-21 14:59:16 +01:00
isaacs c274d16435 2013.03.21, Version 0.10.1 (Stable)
* npm: upgrade to 1.2.15

* crypto: Improve performance of non-stream APIs (Fedor Indutny)

* tls: always reset this.ssl.error after handling (Fedor Indutny)

* tls: Prevent mid-stream hangs (Fedor Indutny, isaacs)

* net: improve arbitrary tcp socket support (Ben Noordhuis)

* net: handle 'finish' event only after 'connect' (Fedor Indutny)

* http: Don't hot-path end() for large buffers (isaacs)

* fs: Missing cb errors are deprecated, not a throw (isaacs)

* fs: make write/appendFileSync correctly set file mode (Raymond Feng)

* stream: Return self from readable.wrap (isaacs)

* stream: Never call decoder.end() multiple times (Gil Pedersen)

* windows: enable watching signals with process.on('SIGXYZ') (Bert Belder)

* node: revert removal of MakeCallback (Trevor Norris)

* node: Unwrap without aborting in handle fd getter (isaacs)
2013-03-20 18:15:04 -07:00
isaacs 3dd7938c03 npm: upgrade to 1.2.15 2013-03-20 17:49:57 -07:00
Fedor Indutny 855caa82aa crypto: initialize transform lazily 2013-03-20 16:49:08 -07:00
isaacs 008ab12b7f tls: Prevent hang in readStart
This is not a great fix, and it's a bug that's very tricky to reproduce.

Occasionally, while downloading a file, especially on Linux for some
reason, the pause/resume timing will be just right such that the
CryptoStream is in a 'reading' state, but actually has no data, so it
ought to pull more in.  Because there's no reads happening, it just sits
there, and the process will exit

This is, fundamentally, a factor of how the HTTP implementation sits
atop CryptoStreams and TCP Socket objects, which is utterly horrible,
and needs to be rewritten.  However, in the meantime, npm downloads are
prematurely exiting, causing hard-to-debug "cb() never called!" errors.
2013-03-20 16:14:39 -07:00
Trevor Norris 31314b6978 bench: compare binaries equal times
The benchmark compare would drop the last run of the binary pairs. So
when they were only run once an error would arise because no data was
generated for the second binary.
2013-03-20 20:25:48 +01:00
Ben Noordhuis 3dac421393 bench: add dgram send/recv benchmark 2013-03-20 17:16:30 +01:00