Commit Graph

8861 Commits (b8c04b921b626edd4201f805d0feb384c8e91ea7)

Author SHA1 Message Date
Ben Noordhuis b8c04b921b Merge remote-tracking branch 'origin/v0.10'
Conflicts:
	AUTHORS
	ChangeLog
	deps/uv/ChangeLog
	deps/uv/src/version.c
	deps/uv/src/win/fs.c
	src/node.cc
	src/node_crypto.cc
	src/node_os.cc
	src/node_version.h
2013-07-30 15:19:48 +02:00
Ben Noordhuis 6327d67be3 crypto: fix assert() on malformed hex input
Use the StringBytes::IsValidString() function introduced in commit
dce26cc to ensure that the input string meets the expectations of the
other StringBytes functions before processing it further.

Fixes the following assertion:

    Assertion failed: (str->Length() % 2 == 0 && "invalid hex string
    length"), function StorageSize, file ../../src/string_bytes.cc,
    line 301.

Fixes #5725.
2013-07-30 14:34:19 +02:00
Ben Noordhuis dce26ccea1 string_bytes: add StringBytes::IsValidString()
Performs a quick, non-exhaustive check on the input string to see if
it's compatible with the specified string encoding.

Curently it only checks that hex strings have a length that is a
multiple of two.
2013-07-30 14:32:47 +02:00
Ben Noordhuis dc9acd4fae assert: replace !!!value with just !value
Not harmful, just code cleanup.

Fixes #5885.
2013-07-30 13:29:20 +02:00
Ben Noordhuis 6bd922fce8 dgram: report send errors to cb, don't pass bytes
Passing the number of sent bytes to the callback is superfluous;
datagram sockets operate in atomic mode: either the sendmsg() system
call succeeds or it fails but it never does partial writes.

Instead, report send errors to the callback. UDP error reporting is
fairly haphazard on most platforms. You should not expect reliable
delivery of anything besides EMSGSIZE and (possibly) ENETDOWN and
ENETUNREACH.

Fixes #2608.
2013-07-29 06:48:46 +02:00
Ben Noordhuis 34b0a36120 src: don't use NewExternal() with unaligned strings
V8 3.20.9 enforces that external pointers are aligned on a two-byte
boundary.

We cannot portably guarantee that for the source code strings that
tools/js2c.py generates so simply stop using String::NewExternal()
altogether (and by extension String::ExternalAsciiStringResource).

Fixes the following run-time assert:

  FATAL ERROR: v8::String::NewExternal() Pointer is not aligned
2013-07-29 05:11:00 +02:00
Ben Noordhuis 1bd711c8a0 v8: upgrade to v8 3.20.9 2013-07-29 21:21:03 +02:00
Andrew Paprocki 17fbd6cd66 doc: vm: fix incorrect API documentation
On timeout, an Error object is thrown, not null.
2013-07-29 17:34:13 +02:00
Ben Noordhuis c13bfdc091 child_process: add 'shell' option to .exec()
No test, we can't rely on an alternate shell being available.

Fixes #5935.
2013-07-29 16:41:56 +02:00
Fedor Indutny 38176d3a1a test: loosen timeout in https-no-reader
fix #5925
2013-07-29 13:33:01 +04:00
Ben Noordhuis 8f571b52a7 src: remove unused tick_spinner 2013-07-28 19:07:59 +02:00
Ben Noordhuis e5233939be test: cluster: add 'bind to privileged port' tests 2013-07-28 14:52:01 +02:00
Ben Noordhuis 04f87de3da cluster: fix shared handle bind error propagation
A failed bind() was already being correctly reported in round-robin
mode. This commit fixes bind() error reporting in shared handle mode.

Fixes #5774.
2013-07-28 14:50:17 +02:00
Ben Noordhuis 2b569deed3 cluster: remove duplicate this.errno assignment 2013-07-28 11:36:13 +02:00
Ben Noordhuis 4881a6a9a3 doc: clarify fs.read() offset argument 2013-07-28 00:05:10 +02:00
Andrew Chilton 767c5bf01d doc: add nodejs.geek.nz to the community page 2013-07-27 16:02:05 +02:00
Rod Vagg df1673202c doc: add nodejs.org.au to community listing 2013-07-27 12:25:59 +02:00
Maciej Małecki d713db245b doc: document possible return values of os.arch() 2013-07-26 17:55:55 -07:00
Dav Glass 7d654be627 doc: Fix missing backtick in debugger doc 2013-07-25 16:17:41 -07:00
isaacs 993bb93e0a streams: Don't emit 'end' until read() past EOF
This prevents the following sort of thing from being confusing:

```javascript
stream.on('data', function() { console.error('got data'); });
stream.pause(); // stop reading

// turns out no data is available
stream.push(null);

// Hand the stream to someone else, who does stuff...
setTimeout(function() {
  // too late! 'end' is already emitted!
  stream.on('end', function() { console.error('got end'); });
});
```

With this change, the `end` event is not emitted until you call `read()`
*past* the EOF null.  So, a paused stream will not swallow the `end`
event and emit it before you `resume()` the stream.
2013-07-25 13:14:49 -07:00
Fedor Indutny 508a6c2eee openssl: use asm for sha, md5, rmd 2013-07-25 18:27:26 +04:00
Ben Noordhuis e4363145ba test: fix simple/test-setproctitle
The title shouldn't be too long; libuv's uv_set_process_title() out of
security considerations no longer overwrites envp, only argv, so the
maximum title length is possibly quite short.

Fixes #5908.
2013-07-25 12:29:20 +02:00
Timothy J Fontaine 180f987147 blog: Post for v0.10.15 2013-07-25 17:03:21 -07:00
Timothy J Fontaine 33267337fa Now working on 0.10.16 2013-07-25 17:03:03 -07:00
Timothy J Fontaine 272525714d Merge branch 'v0.10.15-release' into v0.10 2013-07-25 17:02:38 -07:00
Timothy J Fontaine 2426d65af8 2013.07.25, Version 0.10.15 (Stable)
* src: fix process.getuid() return value (Ben Noordhuis)
2013-07-25 16:26:15 -07:00
Ben Noordhuis 015ec05272 src: fix process.getuid() return value
And process.getgid() too.

Commit ed80638 changed fs.chown() and fs.fchown() to only accept
unsigned integers. Make process.getuid() and process.getgid() follow
suit.

This commit should unbreak npm on OS X - it's hitting the new 'uid must
be an unsigned int' check when installing as e.g. user 'nobody' (which
has an UID of -2 in /etc/passwd or 4294967294 when cast to an uid_t.)

Fixes #5904.
2013-07-26 00:29:03 +02:00
Ben Noordhuis 0de5b831e2 doc: document tls.Server 'secureProtocol' option 2013-07-25 23:21:54 +02:00
Timothy J Fontaine 0256edc43e blog: Post for v0.10.14 2013-07-25 13:54:55 -07:00
Timothy J Fontaine 90c448de23 Now working on 0.10.15 2013-07-25 13:54:16 -07:00
Timothy J Fontaine e2a598b5f2 Merge branch 'v0.10.14-release' into v0.10 2013-07-25 13:53:45 -07:00
Timothy J Fontaine fdf57f811f 2013.07.25, Version 0.10.14 (Stable)
* uv: Upgrade to v0.10.13

* npm: Upgrade to v1.3.5

* os: Don't report negative times in cpu info (Ben Noordhuis)

* fs: Handle large UID and GID (Ben Noordhuis)

* url: Fix edge-case when protocol is non-lowercase (Shuan Wang)

* doc: Streams API Doc Rewrite (isaacs)

* node: call MakeDomainCallback in all domain cases (Trevor Norris)

* crypto: fix memory leak in LoadPKCS12 (Fedor Indutny)
2013-07-25 11:49:01 -07:00
Timothy J Fontaine 5c81f41e70 uv: Upgrade to v0.10.13 2013-07-25 10:48:29 -07:00
Fedor Indutny d62c2d975a tls: share tls tickets key between cluster workers
fix #5871
2013-07-25 01:16:00 +04:00
Fedor Indutny 509cfbc2b7 cluster: support setting data on shared server
If `obj` given to `cluster._getServer` has `_setServerData` or
`_getServerData` methods, the data will be synchronized across workers
and stored in master.
2013-07-25 01:15:59 +04:00
isaacs 4bf5211820 doc: explicitly set industry logo height 2013-07-24 13:37:20 -07:00
isaacs ff0de45929 npm: Upgrade to v1.3.5 2013-07-24 13:23:44 -07:00
Ben Noordhuis 44ed42bd97 src: move NODE_MODULE_VERSION to node_version.h 2013-07-24 22:17:35 +02:00
Ben Noordhuis 0330bdf519 lib: macro-ify type checks
Increases the grep factor. Makes it easier to harmonize type checks
across the code base.
2013-07-24 21:49:35 +02:00
Ben Noordhuis 457d529241 tools: fix js2c macro expansion bug
If the same macro was used twice in close proximity, the second one
didn't get expanded.
2013-07-24 21:49:34 +02:00
Ben Noordhuis 4b279f0092 src: rename macros.py to notrace_macros.py
This incarnation of macros.py is only used to disable the (d)trace
macros. Rename it so it better reflects its purpose. A new macros.py
will be added in a follow-up commit.
2013-07-24 21:49:18 +02:00
Ben Noordhuis d8240769c6 src: cares_wrap: remove two unused variables 2013-07-24 18:49:47 +02:00
Trevor Norris c76ed64348 smalloc: add external to alloc with callbacks
Forgot to actually assign cb_info to the External in smalloc::Alloc()
that accepts a callback to be run in the weak callback.
2013-07-24 09:17:10 -07:00
Trevor Norris 8ce02cf0aa buffer: misc logic simplification
Includes:
* No need for `typeof` when checking undefined.
* length is coerced to uint so no need to check if < 0.
* Stay consistent and always throw `new` errors.
* Returning offset + magic number in every write is error prone. Instead
  return the central write function which returns the correct offset.
2013-07-23 11:02:47 -07:00
Trevor Norris d74932e518 buffer: revert length and parent check
In a rush to implement the fix 35e0d60 I overlooked the logic that
causes 0-length buffer instantiation to automatically not assign the
parent regardless.
2013-07-23 10:43:48 -07:00
Ben Noordhuis e20811a628 src: os: use Number::New() for CPU info
The return values from uv_cpu_info() don't necessarily fit in a 32 bits
signed integer.

Fixes #5732.
2013-07-23 17:12:17 +02:00
Ben Noordhuis ed806385bf fs: uids and gids must be unsigned ints
Before this commit, fs.chown() and fs.fchown() coerced the uid and gid
arguments to signed integers which is wrong because uid_t and gid_t are
unsigned on most all platforms and IDs that don't fit in a signed
integer do exist.

This commit changes the aforementioned functions to take unsigned ints
instead.  No test because we can't assume the system has [GU]IDs that
large.

This change depends on joyent/libuv@d779eb5.

Fixes #5890.
2013-07-23 13:36:46 +02:00
David Björklund d904c231b6 crypto: Add test for sha.write(''); sha.end() 2013-07-22 18:43:06 -07:00
Trevor Norris 35e0d60d0c buffer: slice on zero length buffer
SlowBuffer(0) passes NULL instead of doing malloc(0). So when someone
attempted to SlowBuffer(0).slice(0, 1) an assert would fail in
smalloc::SliceOnto.

It's important that the check go where it is because the resulting
Buffer needs to have external array data allocated. In the case a user
tries to slice a zero length Buffer it will also have NULL passed as the
data argument.

Also fixed where the .parent attribute was set for zero length Buffers.
There is no need to track the source of slice if the slice isn't
actually occurring.
2013-07-22 17:27:59 -07:00
isaacs 0f8de5e1f9 stream: Simplify flowing, passive data listening
Closes #5860

In streams2, there is an "old mode" for compatibility.  Once switched
into this mode, there is no going back.

With this change, there is a "flowing mode" and a "paused mode".  If you
add a data listener, then this will start the flow of data.  However,
hitting the `pause()` method will switch *back* into a non-flowing mode,
where the `read()` method will pull data out.

Every time `read()` returns a data chunk, it also emits a `data` event.
In this way, a passive data listener can be added, and the stream passed
off to some other reader, for use with progress bars and the like.

There is no API change beyond this added flexibility.
2013-07-22 16:17:30 -07:00