0
0
mirror of https://github.com/nodejs/node.git synced 2024-11-25 08:19:38 +01:00
Commit Graph

10993 Commits

Author SHA1 Message Date
Brendan Ashworth
0df54303c1 test: common.js -> common
This commit changes many test styles to change all references
from require('./common.js'); to require('./common');.

The latter is much more common, with the former only being used in 50
tests. It is just a stylistic change, and it seems that `common.js` was
introduced by a rogue test and copied and pasted into the rest.

Semver: patch
PR-URL: https://github.com/iojs/io.js/pull/917
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2015-02-22 19:34:17 -08:00
Fedor Indutny
b9686233fc stream_base: introduce StreamBase
StreamBase is an improved way to write C++ streams. The class itself is
for separting `StreamWrap` (with the methods like `.writeAsciiString`,
`.writeBuffer`, `.writev`, etc) from the `HandleWrap` class, making
possible to write abstract C++ streams that are not bound to any uv
socket.

The following methods are important part of the abstraction (which
mimics libuv's stream API):

* Events:
  * `OnAlloc(size_t size, uv_buf_t*)`
  * `OnRead(ssize_t nread, const uv_buf_t*, uv_handle_type pending)`
  * `OnAfterWrite(WriteWrap*)`
* Wrappers:
  * `DoShutdown(ShutdownWrap*)`
  * `DoTryWrite(uv_buf_t** bufs, size_t* count)`
  * `DoWrite(WriteWrap*, uv_buf_t*, size_t count, uv_stream_t* handle)`
  * `Error()`
  * `ClearError()`

The implementation should provide all of these methods, thus providing
the access to the underlying resource (be it uv handle, TLS socket, or
anything else).

A C++ stream may consume the input of another stream by replacing the
event callbacks and proxying the writes. This kind of API is actually
used now for the TLSWrap implementation, making it possible to wrap TLS
stream into another TLS stream. Thus legacy API calls are no longer
required in `_tls_wrap.js`.

PR-URL: https://github.com/iojs/io.js/pull/840
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
Reviewed-By: Chris Dickinson <christopher.s.dickinson@gmail.com>
2015-02-22 22:31:57 +03:00
Bert Belder
97b424365a deps: make node-gyp work again on windows
* Fetch from the correct url.
* Link compiled addons with iojs.lib instead of node.lib.
* Disable checksum checks for iojs.lib until our website supports
  them.

PR: https://github.com/iojs/io.js/pull/422
Reviewed-by: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-by: Rod Vagg <rod@vagg.org>
2015-02-22 07:43:06 +01:00
Ben Noordhuis
19e3d5e10a deps: make node-gyp fetch tarballs from iojs.org
Apply a small patch that makes node-gyp fetch the tarballs from
https://iojs.org/ instead of http://nodejs.org/

A patch better suited for inclusion upstream will be put together
shortly.

PR-URL: https://github.com/iojs/io.js/pull/343
Reviewed-By: Rod Vagg <rod@vagg.org>
2015-02-22 07:43:06 +01:00
Forrest L Norvell
1e2fa1537f deps: upgrade npm to 2.6.0
PR-URL: https://github.com/iojs/io.js/pull/904
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2015-02-22 07:42:24 +01:00
René Kooi
3ab9b92e90 doc: fix stream _writev header size
PR-URL: https://github.com/iojs/io.js/pull/916
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2015-02-21 21:36:44 +01:00
cjihrig
1f40b2a636 fs: add type checking to makeCallback()
This commit adds proper type checking to makeCallback(). Anything
other than undefined or a function will throw.

PR-URL: https://github.com/iojs/io.js/pull/866
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Vladimir Kurchatkin <vladimir.kurchatkin@gmail.com>
2015-02-21 12:13:43 -05:00
Bruno Jouhier
c82e580a50 fs: properly handle fd passed to truncate()
Currently, fs.truncate() silently fails when a file descriptor
is passed as the first argument. This commit changes this
behavior to properly call fs.ftruncate().

PR-URL: https://github.com/joyent/node/pull/9161
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Timothy J Fontaine <tjfontaine@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>

Conflicts:
	lib/fs.js
2015-02-21 12:13:21 -05:00
Shinnosuke Watanabe
4fcbb8aaaf doc: use HTTPS URL for the API documentation page
PR-URL: https://github.com/iojs/io.js/pull/913
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2015-02-21 09:30:46 -05:00
cjihrig
d8eb974a98 net: make Server.prototype.unref() persistent
Currently, the unref() method does not remember any state
if called before the server's handle has been created. This
commit adds state to track calls to ref() and unref().

PR-URL: https://github.com/iojs/io.js/pull/897
Reviewed-By: Evan Lucas <evanlucas@me.com>
Reviewed-By: Brendan Ashworth <brendan.ashworth@me.com>
2015-02-20 17:37:10 -08:00
Trevor Norris
26ebe9805e smalloc: extend user API
node::Environment isn't accessible to user APIs, so extend smalloc to
also accept v8::Isolate.

Fixes: 75adde07 "src: remove `node_isolate` from source"
PR-URL: https://github.com/iojs/io.js/pull/905
Reviewed-by: Fedor Indutny <fedor@indutny.com>
2015-02-20 11:02:33 -07:00
Brian White
329f364ea2 doc: fix PR reference in CHANGELOG
The CHANGELOG referenced PR 847, but should really be 846.

PR-URL: https://github.com/iojs/io.js/pull/903
Reviewed-By: Christian Tellnes <christian@tellnes.no>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2015-02-20 10:38:05 -05:00
Rod Vagg
0ac57317aa doc: fix typo, rephrase cipher change in CHANGELOG
PR-URL: https://github.com/iojs/io.js/pull/902
Reviewed-By: Roman Reiss <me@silverwind.io>
2015-02-20 20:44:07 +11:00
Rod Vagg
3e984c38b5 Working on v1.3.0 2015-02-20 20:29:54 +11:00
Rod Vagg
1d7a47f29c 2015-02-20 io.js v1.3.0 Release
Notable changes:

* url: `url.resolve('/path/to/file', '.')` now returns `/path/to/`
  with the trailing slash, `url.resolve('/', '.')` returns `/`.
  https://github.com/iojs/io.js/issues/278 (Amir Saboury)
* tls: tls (and in turn https) now rely on a stronger default
  cipher suite which excludes the RC4 cipher. If you still want to
  use RC4, you have to specify your own ciphers suite.
  https://github.com/iojs/io.js/issues/826 (Roman Reiss)
2015-02-20 20:27:42 +11:00
Rod Vagg
afdef70fcc doc: update AUTHORS list
Update AUTHORS file using tools/update-authors.sh

PR-URL: https://github.com/iojs/io.js/pull/900
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2015-02-20 20:13:23 +11:00
Rod Vagg
1bf91878e7 doc: add TC meeting 2015-02-04 minutes
Closes #701
PR-URL: https://github.com/iojs/io.js/pull/876
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2015-02-20 12:39:07 +11:00
Emily Rose
9e05c8d2fc doc: remove outdated language on consensus
PR: https://github.com/iojs/io.js/pull/898
Reviewed-by: Bert Belder <bertbelder@gmail.com>
Reviewed-By: Mikeal Rogers <mikeal.rogers@gmail.com>
2015-02-20 12:15:02 +11:00
Fedor Indutny
9b6b05556f net: unref timer in parent sockets
`TLSSocket` wraps the original `net.Socket`, but writes/reads to/from
`TLSSocket` do not touch the timers of original `net.Socket`.

Introduce `socket._parent` property, and iterate through all parents
to unref timers and prevent timeout event on original `net.Socket`.

Fix: https://github.com/joyent/node/issues/9242
PR-URL: https://github.com/iojs/io.js/pull/891
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2015-02-19 18:44:10 +01:00
cjihrig
ecef87177a fs: ensure nullCheck() callback is a function
Currently, nullCheck() will attempt to invoke any truthy value
as a function if the path argument contains a null character.
This commit validates that the callback is actually a function
before trying to invoke it. fs.access() was vulnerable to this
bug, as nullCheck() was called prior to type checking its
callback.

PR-URL: https://github.com/iojs/io.js/pull/887
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2015-02-19 11:26:18 -05:00
Roman Reiss
ed240f44f7 doc: document 'ciphers' option of tls.connect
This option has been there for a long time, but has never been
documented. It's functionally identical to the server counterpart.

PR-URL: https://github.com/iojs/io.js/pull/845
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2015-02-18 15:15:18 +01:00
Ben Noordhuis
b5f25a963c src: ensure that file descriptors 0-2 are valid
Check that stdin, stdout and stderr map to open file descriptors and
remap them to /dev/null if that isn't the case.  Protects against
information leaks or worse when io.js is started with closed stdio
file descriptors.

PR-URL: https://github.com/iojs/io.js/pull/875
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Vladimir Kurchatkin <vladimir.kurchatkin@gmail.com>
2015-02-18 15:15:14 +01:00
Ben Noordhuis
a956791f69 src: fix typo in error message
PR-URL: https://github.com/iojs/io.js/pull/875
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Vladimir Kurchatkin <vladimir.kurchatkin@gmail.com>
2015-02-18 15:15:14 +01:00
Ben Noordhuis
fb28c91074 src: fix add-on builds, partially revert 8aed9d66
Commit 8aed9d66 ("src: cleanup `Isolate::GetCurrent()`") breaks building
add-ons because of the following:

    In file included from ../node_modules/nan/nan.h:27:0,
                     from ../src/binding.cc:18:
    /home/bnoordhuis/src/v1.x/src/node_object_wrap.h: In member function
    'v8::Local<v8::Object> node::ObjectWrap::handle()':
    /home/bnoordhuis/src/v1.x/src/node_object_wrap.h:39:46: error: base
    operand of '->' has non-pointer type 'v8::Persistent<v8::Object>'
         return v8::Local<v8::Object>::New(handle_->GetIsolate(),
                                           persistent());

Mea culpa, I was one of the reviewers.

PR-URL: https://github.com/iojs/io.js/pull/868
Reviewed-By: Vladimir Kurchatkin <vladimir.kurchatkin@gmail.com>
2015-02-18 00:07:49 +03:00
jigsaw
0555b3c785 doc: fix typo miliseconds -> milliseconds
PR-URL: https://github.com/iojs/io.js/pull/865
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2015-02-17 10:55:13 -05:00
Trevor Norris
c6fd2c5e95 buffer: fix pool offset adjustment
If the Buffer allocation isn't a slice then there's no need to adjust
the pool offset after realloc'ing the space available.

Fixes: 6462519 "buffer, doc: misc. fix and cleanup"
2015-02-16 14:09:50 -07:00
Roman Reiss
77f35861d0 tls: more secure defaults
This updates the default cipher suite to an more secure list, which
prefers strong ciphers with Forward Secrecy. Additionally, it enables
`honorCipherOrder` by default.

Noteable effect of this change is that the insecure RC4 ciphers are
disabled and that Chrome negotiates a more secure ECDHE cipher.

Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Fedor Indutny <fedor@indutny.com>
PR-URL: https://github.com/iojs/io.js/pull/826
2015-02-16 12:33:12 +01:00
Rod Vagg
20f8e7f17a test: remove flaky test functionality
Reverts https://github.com/joyent/node/pull/8689

PR-URL: https://github.com/iojs/io.js/pull/812
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: Johan Bergström <bugs@bergstroem.nu>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2015-02-16 15:27:33 +11:00
Jimmy Hsu
fc6507dd4e doc: add comma in README to increase clarity
Minor change to increase clarity of what is being referenced to.
2015-02-16 11:27:17 +11:00
Roman Reiss
30e340ad9d test: fix parallel/test-tls-getcipher
The test blindly assumes that the default cipher suite supports RC4
ciphers. This corrects the case where RC4 might not be available in the
default ciphers by setting the client to use the same suite as the
server.

PR-URL: https://github.com/iojs/io.js/pull/853
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2015-02-15 18:43:06 +01:00
Brian White
35ed79932c benchmark: add a few querystring benchmarks
PR-URL: https://github.com/iojs/io.js/pull/847
Reviewed-By: Brendan Ashworth <brendan.ashworth@me.com>
2015-02-14 23:41:52 -08:00
cjihrig
d53b636d94 test: verify fields in spawn{Sync} errors
This commit validates the properties of ENOENT error objects
returned by spawn() and spawnSync().

PR-URL: https://github.com/iojs/io.js/pull/838
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Rod Vagg <rod@vagg.org>
2015-02-13 19:06:36 -05:00
Charmander
f0296933f8 doc: correct it's to its in process
"This event is emitted when io.js empties its event loop..."

PR-URL: https://github.com/iojs/io.js/pull/837
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
2015-02-13 16:36:40 -05:00
Wyatt Preul
e81731ad18 doc: add geek as collaborator
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
PR-URL: #835
2015-02-13 13:19:21 -06:00
Amir Saboury
faa687b4be url: reslove urls with . and ..
'.' and '..' are directory specs and resolving urls with or
without the hostname with '.' and '..' should add a trailing
slash to the end of the url.

Fixes: https://github.com/joyent/node/issues/8992
PR-URL: https://github.com/iojs/io.js/pull/278
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2015-02-13 14:05:05 -05:00
cjihrig
cca8de6709 net: remove use of arguments in Server constructor
The current implementation uses the arguments object in the Server()
constructor. Since both arguments to Server() are optional, there was a
high likelihood of accessing a non-existent element in arguments, which
carries a performance overhead. This commit replaces the arguments
object with named arguments.

Reviewed-by: Trevor Norris <trev.norris@gmail.com>

Conflicts:
	lib/net.js
2015-02-13 13:37:25 -05:00
Debjeet Biswas
4ca7cca84a doc: grammar fix in smalloc
PR-URL: https://github.com/joyent/node/pull/9164
Reviewed-by: Colin Ihrig <cjihrig@gmail.com>
2015-02-13 13:37:25 -05:00
Jan Schär
3b1b4de903 test: Timeout#unref() does not return instance
Timeout#unref() call returns undefined, not this. The test already
worked before, because the interval was still unref'd, and the test also
succeeds without clearing the interval.

PR-URL: https://github.com/joyent/node/pull/9171
Reviewed-by: Colin Ihrig <cjihrig@gmail.com>
Reviewed-by: Timothy J Fontaine <tjfontaine@gmail.com>

Conflicts:
	test/simple/test-timers-unref.js
2015-02-13 13:37:25 -05:00
Dan Dascalescu
30dca66958 doc: fix code syntax
Add a ';' to the end of a function call in documentation.

PR-URL: https://github.com/joyent/node/pull/9198
Reviewed-by: Trevor Norris <trev.norris@gmail.com>
2015-02-13 13:37:25 -05:00
Herbert Vojčík
6a2b204bbc module: replace NativeModule.require
The NativeModule system passes NativeModule.require transparently and so
is unnecessary to call explicitly.

The only one which should have the prefix is the in line 295, where
actually implements a big fs-based module system and actually requires a
native module. That is left unchanged.

PR-URL: https://github.com/joyent/node/pull/9201
Ref: https://github.com/joyent/node/issues/2009
Reviewed-by: Trevor Norris <trev.norris@gmail.com>

Conflicts:
	lib/module.js
2015-02-13 13:37:25 -05:00
Andrei Sedoi
8c1df7a8a8 doc: use correct signature for assert()
The message argument is optional for both assert() and
assert.ok(). This commit makes message optional for assert().

PR-URL: https://github.com/joyent/node/pull/9003
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
2015-02-13 13:37:24 -05:00
cjihrig
0cff0521c3 net: throw on invalid socket timeouts
This commit restricts socket timeouts non-negative, finite
numbers. Any other value throws a TypeError or RangeError.
This prevents subtle bugs that can happen due to type
coercion.

Fixes: https://github.com/joyent/node/issues/8618
PR-URL: https://github.com/joyent/node/pull/8884
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
Reviewed-By: Timothy J Fontaine <tjfontaine@gmail.com>

Conflicts:
	lib/timers.js
	test/simple/test-net-settimeout.js
	test/simple/test-net-socket-timeout.js
2015-02-13 13:37:24 -05:00
Omer Wazir
ba40942ad2 doc: fix sentence grammar timers.markdown
Just added ', it' because the phrasing did not seem correct.

PR-URL: https://github.com/iojs/io.js/pull/815
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
2015-02-13 13:18:31 -05:00
Brendan Ashworth
becb4e980e test: distribute crypto tests into separate files
This commit distributes many of the various tests that were previously
strewn about `test-crypto.js` into their own files, such as for Ciphers
and Deciphers, Hashing, and HMACs. Copy pasta, and no style changes
besides removing a few now-unnecessary closures.

Helps eliminate file bloat and allows for easier test prognosis.

PR-URL: https://github.com/iojs/io.js/pull/827
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2015-02-13 12:00:12 -05:00
Omer Wazir
789ff959be doc: increase mark class contrast ratio
PR-URL: https://github.com/iojs/io.js/pull/824
Reviewed-By: Chris Dickinson <christopher.s.dickinson@gmail.com>
2015-02-12 12:12:37 -08:00
Jeremiah Senkpiel
122a1758d1 doc: better font-smoothing for firefox
does the same thing for firefox as 'antialiased' does for webkit.

PR-URL: https://github.com/iojs/io.js/pull/820
Reviewed-By: Chris Dickinson <christopher.s.dickinson@gmail.com>
2015-02-12 12:11:36 -08:00
Roman Reiss
982b143ab3 doc: disable font ligatures
PR-URL: https://github.com/iojs/io.js/pull/816
Reviewed-By:  Nicu Micleușanu <micnic90@gmail.com>
2015-02-12 12:48:32 +02:00
Omer Wazir
cb5560bd62 doc: Close code span correctly
The code span is closed with a straight quote instead of the correct
back tick being used.

PR-URL: https://github.com/iojs/io.js/pull/814
Reviewed-By: Brendan Ashworth <brendan.ashworth@me.com>
2015-02-11 22:20:12 -08:00
Ben Noordhuis
4bb3184d8d src: reduce AsyncWrap memory footprint
Fold two integral fields into one and use bitops to access/manipulate
them.

PR-URL: https://github.com/iojs/io.js/pull/667
Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com>
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
2015-02-11 23:06:29 +01:00
Ben Noordhuis
7e779b4593 src: remove obsoleted queue.h header
It has been obsoleted by the previous commit.  Now it's time to say
goodbye.

PR-URL: https://github.com/iojs/io.js/pull/667
Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com>
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
2015-02-11 23:06:29 +01:00