0
0
mirror of https://github.com/nodejs/node.git synced 2024-12-01 16:10:02 +01:00
Commit Graph

8224 Commits

Author SHA1 Message Date
Ben Noordhuis
75463899c8 dtrace: check if _handle property is set
Check that _handle is an object before trying to read its `fd`
property, avoids bogus values.
2013-04-03 09:52:56 -07:00
Timothy J Fontaine
aca31e37f7 dtrace: actually use the _handle.fd value
When using the DTrace/systemtap subsystems it would be helpful to
actually have an fd associated with the requests and responses.
2013-04-03 09:52:56 -07:00
Dave Pacheco
bf22f99f3a dtrace: pass more arguments to probes
OSX and other DTrace implementations don't support dereferencing
structs in probes. To accomodate that pass members from the struct as
arguments so that DTrace is useful on those systems.
2013-04-03 09:52:56 -07:00
Dave Pacheco
ec69fcf425 build: allow building with dtrace on osx 2013-04-03 09:52:56 -07:00
Brian White
38106da7cd src: remove unused variables 2013-04-02 18:44:14 +02:00
isaacs
234fb122bb http client: Ensure socket cleanup on response end
If an http response has an 'end' handler that throws, then the socket
will never be released back into the pool.

Granted, we do NOT guarantee that throwing will never have adverse
effects on Node internal state.  Such a guarantee cannot be reasonably
made in a shared-global mutable-state side-effecty language like
JavaScript.  However, in this case, it's a rather trivial patch to
increase our resilience a little bit, so it seems like a win.

There is no semantic change in this case, except that some event
listeners are removed, and the `'free'` event is emitted on nextTick, so
that you can schedule another request which will re-use the same socket.
From the user's point of view, there should be no detectable difference.

Closes #5107
2013-04-02 20:34:08 +04:00
Andrew Hart
db8ce89fe4 test: test intended code-paths
The tests did not agree with the test comments. Tests first and second
were both testing the !state.reading case. Now second tests the
state.reading && state.length case.

Fixes joyent/node#5183
2013-04-01 15:09:33 -07:00
isaacs
164d5b3465 tls: Destroy socket when encrypted side closes
The v0.8 Stream.pipe() method automatically destroyed the destination
stream whenever the src stream closed.  However, this caused a lot of
problems, and was removed by popular demand.  (Many userland modules
still have a no-op destroy() method just because of this.) It was also
very hazardous because this would be done even if { end: false } was
passed in the pipe options.

In v0.10, we decided that the 'close' event and destroy() method are
application-specific, and pipe() doesn't automatically call destroy().
However, TLS actually depended (silently) on this behavior.  So, in this
case, we should just go ahead and destroy the thing when close happens.

Closes #5145
2013-04-01 10:53:49 -07:00
Michael Hart
440dcae987 Ensure BAD domain example actually uses domain 2013-04-01 10:09:27 -07:00
Mitar
e5b90a14b8 querystring: Removing unnecessary binding
Binding of `http_parser` in querystring isn't used anywhere and should
be removed.
2013-04-01 14:30:34 +04:00
Nathan Rajlich
55ea7ccf70 repl: use more readable RegExp syntax for spaces
This is just a cosmetic change really, nothing major.
2013-03-30 13:35:36 -07:00
Nathan Rajlich
085f9d636b repl: isSyntaxError() catches "strict mode" errors
Closes #5178.
2013-03-30 13:10:30 -07:00
isaacs
7af075ee30 crypto: Pass options to ctor calls 2013-03-29 09:39:51 -07:00
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