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

8242 Commits

Author SHA1 Message Date
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
Fedor Indutny
34e22b8ee7 tls: always reset this.ssl.error after handling
Otherwise assertion may happen:

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

See #5058
2013-03-20 17:58:01 +04:00
Raymond Feng
25eaacad9a fs: make write/appendFileSync correctly set file mode 2013-03-20 01:37:43 +01:00
Iskren Ivov Chernev
2f4a62c5e1 doc: fix streams2 SimpleProtocol example
A non-existing variable `b` was used to queue data for reading.
2013-03-20 00:34:31 +01:00
Bert Belder
bf83251eea windows: enable watching signals with process.on('SIGXYZ')
This reverts commit ea1cba6246.

The offending commit was intended to land on the v0.8 branch only, but
it accidentally got merged at some point.

Closes #5054.
2013-03-20 00:16:02 +01:00
Bert Belder
8019800c56 Update .mailmap and AUTHORS 2013-03-19 20:07:38 +01:00
Ben Noordhuis
808b7ada07 doc: fix broken links in blog footer
The blog lives at blog.nodejs.org while the main website lives at
nodejs.org. Ergo, use absolute URLs for links to the main website.

Fixes #5062.
2013-03-18 14:41:51 +01:00
Fedor Indutny
b5ddc0cf96 tls: write pending data of opposite side
Fix stucked CryptoStream behaviour, happening when one of the sides
locks-up in queued state.

fix #5023
2013-03-17 20:19:09 +04:00
Trevor Norris
a0867e1c93 node: revert removal of MakeCallback
In 0168109 an implementation of MakeCallback was accidently removed. It
has been re-added.
2013-03-17 13:45:34 +01:00
JeongHoon Byun
f217b5ed62 doc: fix typo in crypto docs 2013-03-17 13:45:14 +01:00
Yi EungJun
852444a720 doc: https: Fix the link to tls.connect 2013-03-16 23:52:39 +01:00
Ben Noordhuis
f5a337e09c deps: upgrade libuv to b45a74f 2013-03-16 23:32:42 +01:00
Ben Noordhuis
2b5bc8e0d6 install: don't install man page twice
Looks like a merge conflict in 77ed12f left in the old, unconditional
install rule. Remove it, the new and improved rule is a few lines down.

Fixes #5044.
2013-03-16 23:22:10 +01:00
Timothy J Fontaine
4432dc8187 v8: move 32 bit heap hint on sunos
Setting the V8 heap at or near 0x20000000 on 32bit sunos only allows
512 MB of heap space, instead on sunos move this to 0x80000000.

Fixes #4010.
2013-03-15 01:31:05 +01:00
isaacs
14947b6c5e stream: Return self from readable.wrap
Also, set paused=false *before* calling resume().  Otherwise,
there's an edge case where an immediately-emitted chunk might make
it call pause() again incorrectly.
2013-03-14 16:43:19 -07:00
isaacs
3537b57f3e test: No need for kicking in streams2 test
This was necessary when we weren't auto-starting when a 'readable'
listener is added.
2013-03-14 16:18:42 -07:00
Gil Pedersen
e8f80bf479 stream: Never call decoder.end() multiple times
Updated version that does what it says without assigning state.decoder.
2013-03-14 16:13:10 -07:00
koichik
1f53cfdeae doc: don't mark fs callbacks as optional
Refs #5005, #5008
2013-03-14 13:06:49 -07:00
isaacs
d62cf59dc1 http: Don't hot-path end() for large buffers
The benefits of the hot-path optimization below start to fall off when
the buffer size gets up near 128KB, because the cost of the copy is more
than the cost of the extra write() call.  Switch to the write/end method
at that point.

Heuristics and magic numbers are awful, but slow http responses are
worse.

Fix #4975
2013-03-14 08:04:59 -07:00
Ben Noordhuis
ca5022b8f1 net: improve arbitrary tcp socket support
Consider this example:

  // fd 3 is a bound tcp socket
  var s = net.createServer(cb);
  s.listen({ fd: 3 });
  console.log(s.address());  // prints null

This commit makes net.Server#address() print the actual address.

Ditto for non-listen sockets; properties like net.Socket#localAddress
and net.Socket#remoteAddress now return the correct value.

Fixes #5009.
2013-03-14 15:55:30 +01:00