Commit Graph

8345 Commits (22533c035d0dbe8abfe699c982a1332b1bfb7b9b)

Author SHA1 Message Date
Ben Noordhuis 22533c035d timers: fix setInterval() assert
Test case:

  var t = setInterval(function() {}, 1);
  process.nextTick(t.unref);

Output:

  Assertion failed: (args.Holder()->InternalFieldCount() > 0),
  function Unref, file ../src/handle_wrap.cc, line 78.

setInterval() returns a binding layer object. Make it stop doing that,
wrap the raw process.binding('timer_wrap').Timer object in a Timeout
object.

Fixes #4261.
2013-05-16 00:02:54 +02:00
Ryan Graham 1deeab29f2 doc: improve exports/module.exports consistency
While they reference the same object, they are only interchangeable
for updates, not assignment.
2013-05-15 21:06:32 +02:00
Ryan Graham 93391ae9cb doc: clarify exports and module.exports
When exporting a single function you must use `module.exports` instead
of the `exports` convenience reference.
2013-05-15 21:05:57 +02:00
Bert Belder 6bcf51e030 uv: upgrade to v0.10.7 2013-05-14 16:52:47 -07:00
isaacs f564b6b58a uv: Upgrade to 0.10.6 2013-05-14 14:41:41 -07:00
isaacs f7b10f5445 npm: Upgrade to 1.2.21 2013-05-14 14:37:59 -07:00
isaacs ca38def146 blog: Release 0.10.6 2013-05-14 14:35:14 -07:00
isaacs ef2b2a3f52 Now working on v0.10.7 2013-05-14 14:33:56 -07:00
isaacs d855e9b125 Merge branch 'v0.10.6-release' into v0.10 2013-05-14 14:33:33 -07:00
isaacs a241deb19a crypto: Pass encodings for Hmac digest 2013-05-14 13:51:43 -07:00
isaacs 5deb1672f2 2013.05.14, Version 0.10.6 (Stable)
* module: Deprecate require.extensions (isaacs)

* stream: make Readable.wrap support objectMode, empty streams (Daniel Moore)

* child_process: fix handle delivery (Ben Noordhuis)

* crypto: Fix performance regression (isaacs)

* src: DRY string encoding/decoding (isaacs)
2013-05-14 13:51:43 -07:00
isaacs c1e8c8de1c crypto: Pass encodings to C++ for Sign/Verify 2013-05-14 13:51:43 -07:00
isaacs 430dc39e87 crypto: use StringBytes::Encode 2013-05-14 13:51:43 -07:00
isaacs a1eacdf12a crypto: Pass strings to binding layer directly 2013-05-14 13:51:43 -07:00
isaacs 119354f735 buffer: DRY string encoding using StringBytes
This also templatizes the Buffer::*Slice functions, and the template
function probably cannot be safely used outside of Node.  However, it
also SHOULD not be used outside of Node, so this is arguably a feature
as well as a caveat.
2013-05-14 13:51:42 -07:00
isaacs 4e8cddddcb src: use StringBytes for DecodeWrite/DecodeBytes/Encode
Bonus: this makes node::Encode actually work properly with base64,
ucs2, hex, etc.
2013-05-14 13:51:42 -07:00
isaacs 69dac92c36 src: Use StringBytes in StreamWrap 2013-05-14 13:51:42 -07:00
isaacs 64fc34b270 src: Add StringBytes static util class
Four functions:

- StringBytes::StorageSize()
- StringBytes::Size()
- StringBytes::Write()
- StringBytes::Encode()
2013-05-14 13:51:24 -07:00
isaacs 3058f08e64 tools: remove unnecessary cpplint rules
We don't actually care about header order much, and since we never use
stl classes, 'string' isn't an issue for node ever.
2013-05-14 11:36:05 -07:00
isaacs d5158574c6 stream: Make default encoding configurable
Pretty much everything assumes strings to be utf-8, but crypto
traditionally used binary strings, so we need to keep the default
that way until most users get off of that pattern.
2013-05-14 11:36:05 -07:00
isaacs bdb78b9945 stream: don't create unnecessary buffers in Readable
If there is an encoding, and we do 'stream.push(chunk, enc)', and the
encoding argument matches the stated encoding, then we're converting from
a string, to a buffer, and then back to a string.  Of course, this is a
completely pointless bit of work, so it's best to avoid it when we know
that we can do so safely.
2013-05-14 11:36:04 -07:00
isaacs 0b8af89363 lint 2013-05-14 11:36:04 -07:00
isaacs 201baa273b benchmark: hash stream 2013-05-14 11:36:04 -07:00
isaacs 6a833a38f6 blog: Release v0.11.2 2013-05-14 11:35:43 -07:00
Benoit Vallée dbe9f8da6b test: increase workers to 8 in cluster-disconnect
Increasing the number of workers from 2 to 8 makes this test
more likely to trigger race conditions. See #5330 for background.
2013-05-14 12:37:39 +02:00
Ben Noordhuis f13a3fd2af doc: clarify subsystems in CONTRIBUTING.md 2013-05-14 12:31:38 +02:00
Ben Noordhuis 21bd456763 child_process: fix handle delivery
Commit 9352c19 ("child_process: don't emit same handle twice") trades
one bug for another.

Before said commit, a handle was sometimes delivered with messages it
didn't belong to.

The bug fix introduced another bug that needs some explaining. On UNIX
systems, handles are basically file descriptors that are passed around
with the sendmsg() and recvmsg() system calls, using auxiliary data
(SCM_RIGHTS) as the transport.

node.js and libuv depend on the fact that none of the supported systems
ever emit more than one SCM_RIGHTS message from a recvmsg() syscall.
That assumption is something we should probably address someday for the
sake of portability but that's a separate discussion.

So, SCM_RIGHTS messages are never coalesced. SCM_RIGHTS and normal
messages however _are_ coalesced. That is, recvmsg() might return this:

  recvmsg();  // { "message-with-fd", "message", "message" }

The operating system implicitly breaks pending messages along
SCM_RIGHTS boundaries. Most Unices break before such messages but Linux
also breaks _after_ them.  When the sender looks like this:

  sendmsg("message");
  sendmsg("message-with-fd");
  sendmsg("message");

Then on most Unices the receiver sees messages arriving like this:

  recvmsg();  // { "message" }
  recvmsg();  // { "message-with-fd", "message" }

The bug fix in commit 9352c19 assumes this behavior. On Linux however,
those messages can also come in like this:

  recvmsg();  // { "message", "message-with-fd" }
  recvmsg();  // { "message" }

In other words, it's incorrect to assume that the file descriptor is
always attached to the first message. This commit makes node wise up.

Fixes #5330.
2013-05-13 10:49:59 -07:00
isaacs 4b69bcfc66 doc: s/search.npmjs.org/npmjs.org/ 2013-05-09 15:15:39 -07:00
Timothy J Fontaine 72c58158f7 test: fix pummel/test-net-many-clients.js
client sockets no longer emit 'connect' event inside the
requestListener, update test-net-many-clients to reflect that
2013-05-08 19:31:45 -07:00
Robert Kowalski dc92ff8585 doc: document stream.Writable 'error' event
Fixes #5255.
2013-05-08 18:15:50 -07:00
Daniel Moore 3b6fc600e2 stream: make Readable.wrap support empty streams
This makes Readable.wrap behave properly when the wrapped stream ends
before emitting any data events.
2013-05-08 11:59:40 -07:00
Daniel Moore 1ad93a6584 stream: make Readable.wrap support objectMode
Added a check to see if the stream is in objectMode before deciding
whether to include or exclude data from an old-style wrapped stream.
2013-05-08 11:59:28 -07:00
Timothy J Fontaine cf87ee67ee test: don't use total_seconds() because of py2.6 2013-05-07 15:40:04 -07:00
Timothy J Fontaine 716176fa99 test: report test duration in TAP progress 2013-05-07 12:51:03 -07:00
Timothy J Fontaine 76cbd039b9 build: only use DESTDIR instead of PREFIX for pkg
Preserve default install prefix seen in process.config, but use DESTDIR
for installing to deliniate 32/64 versions, avoid conflicts with PREFIX
settings in config.mk
2013-05-06 10:10:05 -07:00
Kevin Locke 1c2b03dea5 doc: update options for exec and execFile
The stdio and customFds options are never used by exec or execFile,
remove them from the documentation for these functions.
2013-05-03 16:01:33 +02:00
Miroslav Bajtoš 418c9bc604 build: vcbuild.bat fix for Visual Studio 2012
Change vcbuild.bat to ignore VCINSTALLDIR environment variable,
always check for specific VS version and set GYP_MSVS_VERSION
accordingly. Otherwise GYP generates project files in format
that cannot be compiled by VS2012.
2013-05-03 11:32:32 +02:00
Sam Roberts 41cbdc5e64 doc: document return values of EventEmitter methods 2013-05-03 01:10:01 +02:00
isaacs 0e21d7b985 doc: link joyent logo in website footer 2013-05-02 09:48:33 -07:00
Miroslav Bajtoš a32a243d5f debugger: breakpoints in scripts not loaded yet
When developer calls setBreakpoint with an unknown script name,
we convert the script name into regular expression matching all
paths ending with given name (name can be a relative path too).

To create such breakpoint in V8, we use type `scriptRegEx`
instead of `scriptId` for `setbreakpoint` request.

To restore such breakpoint, we save the original script name
send by the user. We use this original name to set (restore)
breakpoint in the new child process.

This is a back-port of commit 5db936d from the master branch.
2013-05-02 08:52:58 +02:00
Ben Noordhuis 2cf7e5de6f Revert "deps: downgrade openssl to v1.0.0f"
After much investigation it turns out that the affected servers are
buggy.  user-service.condenastdigital.com:443 in particular seems to
reject large TLS handshake records. Cutting down the number of
advertised ciphers or disabling SNI fixes the issue.

Similarly, passing { secureOptions: constants.SSL_OP_NO_TLSv1_2 }
seems to fix most connection issues with IIS servers.

Having to work around buggy servers is annoying for our users but not
a reason to downgrade OpenSSL. Therefore, revert it.

This reverts commit 4fdb8acdae.
2013-05-01 16:45:31 +02:00
isaacs dda7b40204 doc: Fix require.extensions documentation
1. The stability index must come first, or it messes up the markdown
2. require.extensions is an Object, not an Array.

Close #5387
2013-04-30 07:40:43 -07:00
Ben Noordhuis 4fdb8acdae deps: downgrade openssl to v1.0.0f
Several people have reported issues with IIS and Resin servers (or maybe
SSL terminators sitting in front of those servers) that are fixed by
downgrading OpenSSL. The AESNI performance improvements were nice but
stability is more important. Downgrade OpenSSL from 1.0.1e to 1.0.0f.

Fixes #5360 (and others).
2013-04-29 12:12:33 +02:00
Ben Noordhuis 626d7abdb4 doc: cluster: s/server.destroy/server.close/
Fixes #5379.
2013-04-29 12:06:36 +02:00
isaacs 7bd8a5a2a6 doc: Deprecate require.extensions 2013-04-28 22:10:40 -07:00
Miroslav Bajtoš 8c2ad47f42 debugger: `restart` with custom debug port
Fixed a bug in debugger repl where `restart` command did not work
when a custom debug port was specified via command-line option
--port={number}.

File test/simple/helper-debugger-repl.js was extracted
from test/simple/test-debugger-repl.js
2013-04-26 21:10:05 +02:00
isaacs 8e56b4dd1c ChangeLog: Merge in v0.8
Close #5355
2013-04-23 14:43:46 -07:00
isaacs 72cf499b54 blog: Post for v0.10.5 2013-04-23 14:08:01 -07:00
isaacs ec5577cf9d Now working on 0.10.6 2013-04-23 14:07:23 -07:00
isaacs 52aeb3f2fd Merge branch 'v0.10.5-release' into v0.10 2013-04-23 14:07:09 -07:00