Commit Graph

8261 Commits (e5fdc4d6f1af4417ef9bb4ca7050fd633ea09267)

Author SHA1 Message Date
isaacs e5fdc4d6f1 uv: Upgrade to v0.10.4 2013-04-11 09:07:22 -07:00
Ben Noordhuis 212eb8a52e child_process: fix O(n*m) scan of cmd string
Don't scan the whole string for a "NODE_" substring, just check that
the string starts with the expected prefix.

This is a reprise of dbbfbe7 but this time for the child_process
module.
2013-04-11 13:53:18 +02:00
Ben Noordhuis dbbfbe74ca cluster: fix O(n*m) scan of cmd string
Don't scan the whole string for a "NODE_CLUSTER_" substring, just check
that the string starts with the expected prefix. The linear scan was
causing a noticeable (but unsurprising) slowdown on messages with a
large .cmd string property.
2013-04-11 13:42:34 +02:00
Ben Noordhuis cd96f0aba8 src: don't SetInternalField() in ObjectWrap dtor
Call SetPointerInInternalField(0, NULL) rather than
SetInternalField(0, Undefined()).

Fixes the following spurious NULL pointer dereference in debug builds:

  #0  0x03ad2821 in v8::internal::FixedArrayBase::length ()
  #1  0x03ad1dfc in v8::internal::FixedArray::get ()
  #2  0x03ae05dd in v8::internal::Context::global_object ()
  #3  0x03b6b87d in v8::internal::Context::builtins ()
  #4  0x03ae1871 in v8::internal::Isolate::js_builtins_object ()
  #5  0x03ab4fab in v8::CallV8HeapFunction ()
  #6  0x03ab4d4a in v8::Value::Equals ()
  #7  0x03b4f38b in CheckEqualsHelper ()
  #8  0x03ac0f4b in v8::Object::SetInternalField ()
  #9  0x06a99ddd in node::ObjectWrap::~ObjectWrap ()
  #10 0x06a8b051 in node::Buffer::~Buffer ()
  #11 0x06a8afbb in node::Buffer::~Buffer ()
  #12 0x06a8af5e in node::Buffer::~Buffer ()
  #13 0x06a9e569 in node::ObjectWrap::WeakCallback ()
2013-04-10 15:37:30 +02:00
Ben Noordhuis 0d5595ac60 Revert "crypto: use better memory BIO implementation"
This change shouldn't have landed in the stable branch. It's a feature,
not a bug fix.

This reverts commit 58f93ffc4a.
This reverts commit 8c8ebe49b6.
This reverts commit ba0f7b8066.
This reverts commit 21f3c5c367.
2013-04-10 13:54:15 +02:00
Fedor Indutny c665b8e9ba net: fix socket.bytesWritten Buffers support
Buffer.byteLength() works only for string inputs. Thus, when connection
has pending Buffer to write, it should just use it's length instead of
throwing exception.
2013-04-10 14:51:10 +04:00
Ben Noordhuis eeb4c3216d crypto: remove unused ClientHelloParser field 2013-04-10 01:39:00 +02:00
isaacs 67096fdb38 blog: Post for v0.8.23 2013-04-08 17:41:49 -07:00
Łukasz Walukiewicz 2e28832660 buffer: fix offset checks
Fixed offset checks in Buffer.readInt32LE() and Buffer.readInt32BE()
functions.
2013-04-08 16:17:38 -07:00
isaacs c93af860a0 stream: call write cb before finish event
Since 049903e, an end callback could be called before a write
callback if end() is called before the write is done. This patch
resolves the issue.

In collaboration with @gne

Fixes felixge/node-formidable#209
Fixes #5215
2013-04-09 02:09:51 +04:00
isaacs e4b716efaa http: Support write(data, 'hex')
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.

An unusual edge case, but certainly a bug.
2013-04-08 09:33:56 -07:00
Fedor Indutny 037bcac7ba crypto: dh secret should be left-padded
DH_compute_secret() may return key that is smaller than input buffer,
in such cases key should be left-padded because it is a BN (big number).

fix #5239
2013-04-08 19:45:35 +04:00
Rod Vagg ccabd4a6fa process: expose NODE_MODULE_VERSION in process.versions 2013-04-08 16:48:18 +02:00
Fedor Indutny 21f3c5c367 crypto: move write_head in bio's Reset() method 2013-04-08 15:53:25 +04:00
Fedor Indutny ba0f7b8066 crypto: fix changing buffers in bio
We should go to next buffer if *current* one is full, not the next one.
Otherwise we may hop through buffers and written data will become
interleaved, which will lead to failure.
2013-04-08 15:51:55 +04:00
Fedor Indutny 8c8ebe49b6 crypto: fix style issues in bio
Stop changing arguments, use local variables for things that change.
2013-04-08 15:51:51 +04:00
Andreas Madsen fed8cff1d0 crypto: fix constructor call in crypto streams
When using some stream method on a lazy crypto stream, the transform
constructor wasn't called. This caused the internal state object to
be undefined.
2013-04-08 14:45:42 +04:00
Fedor Indutny ff32ecd5bf net: account encoding in .byteLength 2013-04-08 11:48:46 +04:00
Ben Noordhuis e8c01739cd doc: document linux pwrite() bug
On Linux, positional writes don't work when the file is opened in
append mode. The kernel ignores the position argument and always
appends the data to the end of the file.

To quote the man page:

  POSIX requires that opening a file with the O_APPEND flag should have
  no affect on the location at which pwrite() writes data.  However, on
  Linux, if a file is opened with O_APPEND, pwrite() appends data to the
  end of the file, regardless of the value of offset.
2013-04-08 00:43:30 +02:00
Fedor Indutny eb39c9854a net: fix buffer iteration in bytesWritten 2013-04-08 01:17:40 +04:00
Fedor Indutny 77715edee8 crypto: zero is not an error if writing 0 bytes
fix #5128
2013-04-07 22:10:19 +04:00
Tobias Müllerleile 4108c31293 tls: Re-enable check of CN-ID in cert verification
RFC 6125 explicitly states that a client "MUST NOT seek a match
for a reference identifier of CN-ID if the presented identifiers
include a DNS-ID, SRV-ID, URI-ID, or any application-specific
identifier types supported by the client", but it MAY do so if
none of the mentioned identifier types (but others) are present.
2013-04-07 22:09:57 +04:00
Rafael Garcia bd0d45818e stream: unused variable 2013-04-05 12:05:58 -07:00
Rafael Garcia ea4f0b4a6b stream: remove vestiges of previous _transform API 2013-04-05 12:05:58 -07:00
isaacs aeef9518c6 doc: Correct caveats for http Readables 2013-04-05 11:07:53 -07:00
Fedor Indutny 58f93ffc4a crypto: use better memory BIO implementation 2013-04-05 04:12:13 +04:00
isaacs 0f460b03f3 blog: Post about 0.10.3 2013-04-03 11:28:09 -07:00
isaacs 734a19060c Now working on 0.10.4 2013-04-03 11:28:04 -07:00
isaacs d1c9c93ef0 Merge branch 'v0.10.3-release' into v0.10 2013-04-03 11:27:55 -07:00
Fedor Indutny 55d058e624 v8: cherry-pick 75311294 from upstream
Quote from commit message:

    Create a new HandleScope for each JSON-parsed object to avoid
    excessive growth.
2013-04-03 22:11:32 +04:00
isaacs d4982f6f5e 2013.04.03, Version 0.10.3 (Stable)
* npm: Upgrade to 1.2.17

* child_process: acknowledge sent handles (Fedor Indutny)

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

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

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

* http: Remove legacy ECONNRESET workaround code (isaacs)

* http: Ensure socket cleanup on client response end (isaacs)

* tls: Destroy socket when encrypted side closes (isaacs)

* repl: isSyntaxError() catches "strict mode" errors (Nathan Rajlich)

* crypto: Pass options to ctor calls (isaacs)

* src: tie process.versions.uv to uv_version_string() (Ben Noordhuis)
2013-04-03 10:30:57 -07:00
isaacs 88686aa410 http: Remove legacy ECONNRESET workaround code
Fix #5179
2013-04-03 10:18:42 -07:00
isaacs d46ebffb66 npm: Upgrade to 1.2.17 2013-04-03 10:17:04 -07:00
isaacs b319264d84 test: fork-getconnections stricter, less chatty 2013-04-03 10:01:50 -07:00
Fedor Indutny 5902bc45c5 child_process: acknowledge sent handles
Fix race-condition when multiple handles are sent and SCM_RIGHTS
messages are gets merged by OS by avoiding sending multiple handles at
once!

fix #4885
2013-04-03 09:56:48 -07:00
isaacs 4716dc662d assert: Simplify AssertError creation 2013-04-03 09:52:56 -07:00
Timothy J Fontaine 9f65b1edf7 etw: update prototypes to match dtrace provider
The DTrace probes were updated to accomodate platforms that can't
handle structs, update the prototypes for ETW but it's not necessary
to do anything with the new arguments as it's redundant information.
2013-04-03 09:52:56 -07:00
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