Commit Graph

8878 Commits (02cab97490690610ab5c4ce5d76208d415f0d2c4)

Author SHA1 Message Date
Ben Noordhuis 02cab97490 src: more lint after cpplint tightening
Commit 847c6d9 adds a 'project headers before system headers' check
to cpplint. Update the files in src/ to make the linter pass again.
2013-07-31 23:16:26 +02:00
Ben Noordhuis 847c6d980c tools: cpplint: fix up build/include_order rule
Change the build/include_order rule to match our preference:
project headers before system headers.

The rationale is that system headers before project headers makes it
easy to slip in bugs where a project header that requires a definition
from a system header, forgets to include the system header but still
compiles because the source files that include the project header
coincidentally include the system header too.

A good example is the size_t type. A project header file that needs the
definition of size_t should include stddef.h but forgetting to do so
will probably go unnoticed for a long time because almost every other
system header includes stddef.h (either directly or indirectly) and
almost every source file includes one or more system headers.

Ergo, project headers before system headers. It's a good thing.
2013-07-31 22:34:35 +02:00
Antony Bailey 58159e308b doc: remove travis status image
The project has moved to Jenkins. The status image is no longer
needed and perpetually shows a failed build. Remove it.
2013-07-31 21:50:09 +02:00
Fedor Indutny 6caf012d59 etw_provider: unbreak windows build 2013-07-31 22:35:46 +04:00
Fedor Indutny ccf8f3eebc make: add `cpplint` to `test` target
Also, exclude some C-headers, machine generated headers and tweaked
sources from cpplint file list.
2013-07-31 22:12:06 +04:00
Fedor Indutny 8e29ce9f13 src: lint c++ code 2013-07-31 22:12:06 +04:00
Fedor Indutny 3c6b5d5df1 cpplint: make lint rules closer to node's source
* Support C-style header guards (/* comments */)
* Support `class NODE_EXTERN something`
* Support `}  // extern "C"` closures
* Ignore header order
* Ignore `long/short` usage (because of OpenSSL's API)
2013-07-31 22:12:06 +04:00
Trevor Norris 6a5a7b089e node: add inTick and lastThrew to infoBox
To prevent all unnecessary calls to JS from MakeCallback, the remaining
two immediate return variables inTick and lastThrew have been added to
infoBox. Now MakeCallback should never need to call into JS unless it
absolutely has to.

Also removed Tock. Performance tests showed it was at least as fast or
faster than using a normal object, and this is more readable.
2013-07-31 09:25:19 -07:00
Ben Noordhuis 2cd7adc7f4 util: don't throw on circular %j input to format()
Don't throw an exception when the argument to %j is an object that
contains circular references, it's not helpful. Catch the exception
and return the string '[Circular]'.
2013-07-29 21:59:15 +02:00
Trevor Norris 7ca77eaf38 fs: write strings directly to disk
Prior, strings would first be converted to a Buffer before being written
to disk. Now the intermediary step has been removed.

Other changes of note:

* Class member "must_free" was added to req_wrap so to track if the
  memory needs to be manually cleaned up after use.
* External String Resource support, so the memory will be used directly
  instead of copying out the data.
* Docs have been updated to reflect that if position is not a number
  then it will assume null. Previously it specified the argument must be
  null, but that was not how the code worked. An attempt was made to
  only support == null, but there were too many tests that assumed !=
  number would be enough.
* Docs update show some of the write/writeSync arguments are optional.
2013-07-30 14:42:30 -07:00
Trevor Norris 63fc6a63c8 string_bytes: export GetExternalParts
The method is useful elsewhere when needing to check if external and
grab data.
2013-07-30 14:41:01 -07:00
Ben Noordhuis 3ff2cbc892 deps: upgrade libuv to joyent/libuv@4bdb7d8
Non-release upgrade so pending patches can land.
2013-07-30 23:33:45 +02:00
Ben Noordhuis 4cc57b4aca crypto: simplify DH modp group name matcher
* Use ARRAY_SIZE() rather than scanning until we hit a NULL entry.
* Fix `-fsigned-char -Wnarrowing` compiler warnings. Harmless but
  numerous and annoying.
* Static-ify the modp_group and mod_groups arrays.
* Const-ify the modp_groups array.
2013-07-29 20:49:28 +02:00
Ben Noordhuis 8111ca2f9f src: const-ify variables in src/node_crypto*
No functional changes, just some code tightening. Clean up some style
inconsistencies while we are here.
2013-07-30 22:03:49 +02:00
Ben Noordhuis 71b3138925 src: remove unused import in src/node_os.cc 2013-07-30 21:32:45 +02:00
Ben Noordhuis 511af4dd5f string_bytes: don't use named imports in header
It imports the definition into every source file that includes
string_bytes.h, as evidenced by the build suddenly breaking left
and right because of missing Handle/Local/String/Value imports.
2013-07-30 21:31:04 +02:00
Ben Noordhuis 2fc47ab10b v8: upgrade v8 to 3.20.11 2013-07-30 17:14:55 +02:00
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