Jackson Tian [Wed, 10 Dec 2014 03:20:11 +0000 (11:20 +0800)]
doc: add details for http res/req end callback
Add documentation for the callback parameter of http.ClientRequest's and
http.ServerResponse's end methods.
Signed-off-by: Julien Gilli <julien.gilli@joyent.com>
Chris Dickinson [Thu, 4 Dec 2014 20:00:23 +0000 (12:00 -0800)]
stream: switch _writableState.buffer to queue
In cases where many small writes are made to a stream
lacking _writev, the array data structure backing the
WriteReq buffer would greatly increase GC pressure.
Specifically, in the fs.WriteStream case, the
clearBuffer routine would only clear a single WriteReq
from the buffer before exiting, but would cause the
entire backing array to be GC'd. Switching to [].shift
lessened pressure, but still the bulk of the time was
spent in memcpy.
This replaces that structure with a linked list-backed
queue so that adding and removing from the queue is O(1).
In the _writev case, collecting the buffer requires an
O(N) loop over the buffer, but that was already being
performed to collect callbacks, so slowdown should be
neglible.
PR-URL: https://github.com/joyent/node/pull/8826
Reviewed-by: Timothy J Fontaine <tjfontaine@gmail.com>
Reviewed-by: Trevor Norris <trev.norris@gmail.com>
Ben Noordhuis [Tue, 11 Nov 2014 11:06:55 +0000 (12:06 +0100)]
src: fix windows build error
Fix a Windows-only build error that was introduced in
commit
1183ba4 ("zlib: support concatenated gzip files").
Rename the NO_ERROR and FAILED enumerations, they conflict
with macros of the same name in <winerror.h>.
PR-URL: https://github.com/joyent/node/pull/8893
Reviewed-By: Fedor Indutny <fedor@indutny.com>
Reviewed-By: Rod Vagg <rod@vagg.org>
Reviewed-by: Timothy J Fontaine <tjfontaine@gmail.com>
Miroslav Bajtoš [Mon, 4 Nov 2013 14:59:25 +0000 (15:59 +0100)]
debugger: fix unhandled error in setBreakpoint
Fix Interface.setBreakpoint() to correctly handle an attempt to set a
breakpoint in the current script when there is no current script.
This usually happens when the debugged process is not paused.
Fixes: https://github.com/joyent/node/issues/6453
PR-URL: https://github.com/joyent/node/pull/6460
Reviewed-By: Chris Dickinson <christopher.s.dickinson@gmail.com>
Luis Reis [Tue, 9 Sep 2014 16:30:15 +0000 (17:30 +0100)]
zlib: support concatenated gzip files
Reviewed-By: Fedor Indutny <fedor@indutny.com>
PR-URL: https://github.com/joyent/node/pull/6442
Ben Burns [Sat, 26 Jul 2014 14:04:46 +0000 (02:04 +1200)]
doc: clarify create{Read,Write}Stream fd option
Clarify the fd option: it is preferred to the path parameter, omits
the "open" event if given, and is available on WriteStreams as well.
PR-URL: https://github.com/joyent/node/issues/7707
Fixes: https://github.com/joyent/node/issues/7707
Fixes: https://github.com/joyent/node/issues/7708
Fixes: https://github.com/joyent/node/issues/4367
Reviewed-By: Chris Dickinson <christopher.s.dickinson@gmail.com>
cjihrig [Tue, 9 Dec 2014 18:47:49 +0000 (13:47 -0500)]
test: add test for spawnSync() env option
PR-URL: https://github.com/joyent/node/pull/8845
Reviewed-by: Trevor Norris <trev.norris@gmail.com>
Juanjo [Tue, 14 Oct 2014 10:07:19 +0000 (12:07 +0200)]
lib,src: fix spawnSync ignoring its 'env' option
PR-URL: https://github.com/joyent/node/pull/8546
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Alexis Campailla [Wed, 10 Dec 2014 11:58:32 +0000 (12:58 +0100)]
test: mark more tests as flaky
Marking these two tests as flaky, since they have been failing
intermittenly in recent builds:
test-debug-signal-cluster
test-cluster-basic
Saúl Ibarra Corretgé [Tue, 9 Dec 2014 20:01:35 +0000 (21:01 +0100)]
deps: update libuv to 1.0.2
PR-URL: https://github.com/joyent/node/pull/8847
Reviewed-by: Trevor Norris <trev.norris@gmail.com>
Julien Gilli [Wed, 3 Dec 2014 06:55:53 +0000 (22:55 -0800)]
build: do not generate support for libuv's probes
Dtrace probes were removed from libuv recently, but their usage by node
was not completely removed, causing build breaks on SmartOS.
Even though the build is working on other platforms, these probes are
not fired by libuv anymore, so there's no point in using them on these
platforms too.
Reviewed-by: Trevor Norris <trev.norris@gmail.com>
Brendan Ashworth [Sun, 19 Oct 2014 18:54:48 +0000 (11:54 -0700)]
doc: fix grammar and wording in tls and timers
In `tls.markdown`, there was a misuse of 'a' which has been replaced
with 'an'.
In `timers.markdown`...
line 31: misuse of 'a', replaced with 'an'
line 59: unclear wording, haywire 'a', added new comma
Jackson Tian [Tue, 2 Dec 2014 03:14:57 +0000 (11:14 +0800)]
doc: mention callback for http res/req write & end
Add documentation for the callback parameter of http.ClientRequest's and
http.ServerResponse's write and end methods.
Trevor Norris [Fri, 5 Dec 2014 13:34:03 +0000 (05:34 -0800)]
uv: float patch to revert tty breakage
Float https://github.com/libuv/libuv/commit/
484a3a9 to fix incorrect
indentation in REPL.
Trevor Norris [Thu, 20 Nov 2014 19:27:06 +0000 (11:27 -0800)]
async-wrap: add event hooks
Call a user-defined callback at specific points in the lifetime of an
asynchronous event. Which are on instantiation, just before/after the
callback has been run.
**If any of these callbacks throws an exception, there is no forgiveness
or recovery. A message will be displayed and a core file dumped.**
Currently these only tie into AsyncWrap, meaning no call to a hook
callback will be made for timers or process.nextTick() events. Though
those will be added in a future commit.
Here are a few notes on how to make the hooks work:
- The "this" of all event hook callbacks is the request object.
- The zero field (kCallInitHook) of the flags object passed to
setupHooks() must be set != 0 before the init callback will be called.
- kCallInitHook only affects the calling of the init callback. If the
request object has been run through the create callback it will always
run the before/after callbacks. Regardless of kCallInitHook.
- In the init callback the property "_asyncQueue" must be attached to
the request object. e.g.
function initHook() {
this._asyncQueue = {};
}
- DO NOT inspect the properties of the object in the init callback.
Since the object is in the middle of being instantiated there are some
cases when a getter is not complete, and doing so will cause Node to
crash.
PR-URL: https://github.com/joyent/node/pull/8110
Signed-off-by: Trevor Norris <trev.norris@gmail.com>
Reviewed-by: Fedor Indutny <fedor@indutny.com>
Reviewed-by: Alexis Campailla <alexis@janeasystems.com>
Reviewed-by: Julien Gilli <julien.gilli@joyent.com>
Trevor Norris [Mon, 17 Nov 2014 20:54:03 +0000 (12:54 -0800)]
async-wrap: explicitly pass parent
When instantiating a new AsyncWrap allow the parent AsyncWrap to be
passed. This is useful for cases like TCP incoming connections, so the
connection can be tied to the server receiving the connection.
Because the current architecture instantiates the *Wrap inside a
v8::FunctionCallback, the parent pointer is currently wrapped inside a
new v8::External every time and passed as an argument. This adds ~80ns
to instantiation time.
A future optimization would be to add the v8::External as the data field
when creating the v8::FunctionTemplate, change the pointer just before
making the call then NULL'ing it out afterwards. This adds enough code
complexity that it will not be attempted until the current approach
demonstrates it is a bottle neck.
PR-URL: https://github.com/joyent/node/pull/8110
Signed-off-by: Trevor Norris <trev.norris@gmail.com>
Reviewed-by: Fedor Indutny <fedor@indutny.com>
Reviewed-by: Alexis Campailla <alexis@janeasystems.com>
Reviewed-by: Julien Gilli <julien.gilli@joyent.com>
Trevor Norris [Sat, 15 Nov 2014 00:15:06 +0000 (16:15 -0800)]
async-wrap: expose async-wrap as binding
Expose basic hooks for AsyncWrap via the async_wrap binding. Right now
only the PROVIDER types are exposed. This is a preliminary step before
more functionality is added.
PR-URL: https://github.com/joyent/node/pull/8110
Signed-off-by: Trevor Norris <trev.norris@gmail.com>
Reviewed-by: Fedor Indutny <fedor@indutny.com>
Reviewed-by: Alexis Campailla <alexis@janeasystems.com>
Reviewed-by: Julien Gilli <julien.gilli@joyent.com>
Trevor Norris [Fri, 14 Nov 2014 23:47:34 +0000 (15:47 -0800)]
src: remove unnecessary template parameter
The template class information is received via the type of the first
argument. So there is no need to use Wrap<T>(handle).
PR-URL: https://github.com/joyent/node/pull/8110
Signed-off-by: Trevor Norris <trev.norris@gmail.com>
Reviewed-by: Fedor Indutny <fedor@indutny.com>
Reviewed-by: Alexis Campailla <alexis@janeasystems.com>
Reviewed-by: Julien Gilli <julien.gilli@joyent.com>
Trevor Norris [Tue, 26 Aug 2014 19:21:39 +0000 (12:21 -0700)]
src: all wrap's now use actual FunctionTemplate
Instead of simply creating a new v8::Object to contain the connection
information, instantiate a new instance of a FunctionTemplate. This will
allow future improvements for debugging and performance probes.
Additionally, the "provider" argument in the ReqWrap constructor is no
longer optional.
PR-URL: https://github.com/joyent/node/pull/8110
Signed-off-by: Trevor Norris <trev.norris@gmail.com>
Reviewed-by: Fedor Indutny <fedor@indutny.com>
Reviewed-by: Alexis Campailla <alexis@janeasystems.com>
Reviewed-by: Julien Gilli <julien.gilli@joyent.com>
Trevor Norris [Thu, 13 Nov 2014 00:35:48 +0000 (16:35 -0800)]
node: fix throws before timer module is loaded
An edge case could occur when the setImmediate() in _fatalException()
would fire before the timers module had been loaded globally, causing
Node to crash.
PR-URL: https://github.com/joyent/node/pull/8110
Signed-off-by: Trevor Norris <trev.norris@gmail.com>
Reviewed-by: Fedor Indutny <fedor@indutny.com>
Reviewed-by: Alexis Campailla <alexis@janeasystems.com>
Reviewed-by: Julien Gilli <julien.gilli@joyent.com>
Trevor Norris [Thu, 13 Nov 2014 00:08:12 +0000 (16:08 -0800)]
node, async-wrap: remove MakeDomainCallback
C++ won't deoptimize like JS if specific conditional branches are
sporadically met in the future. Combined with the amount of code
duplication removal and simplified maintenance complexity, it makes more
sense to merge MakeCallback and MakeDomainCallback.
Additionally, type casting in V8 before verifying what that type is will
cause V8 to abort in debug mode if that type isn't what was expected.
Fix this by first checking the v8::Value before casting.
PR-URL: https://github.com/joyent/node/pull/8110
Signed-off-by: Trevor Norris <trev.norris@gmail.com>
Reviewed-by: Fedor Indutny <fedor@indutny.com>
Reviewed-by: Alexis Campailla <alexis@janeasystems.com>
Reviewed-by: Julien Gilli <julien.gilli@joyent.com>
Trevor Norris [Wed, 12 Nov 2014 23:58:23 +0000 (15:58 -0800)]
async-wrap: move MakeCallback to .cc
MakeCallback is too large a function to be inlined. Likewise, only
having header files will not allow for any part of AsyncWrap to be
exposed cleanly via NODE_MODULE_CONTEXT_AWARE_BUILTIN().
PR-URL: https://github.com/joyent/node/pull/8110
Signed-off-by: Trevor Norris <trev.norris@gmail.com>
Reviewed-by: Fedor Indutny <fedor@indutny.com>
Reviewed-by: Alexis Campailla <alexis@janeasystems.com>
Reviewed-by: Julien Gilli <julien.gilli@joyent.com>
Trevor Norris [Wed, 12 Nov 2014 00:48:34 +0000 (16:48 -0800)]
src: remove Async Listener
Async Listener was the name of the user-facing JS API, and is being
completely removed. Instead low level hooks directly into the mechanism
that AL used will be introduced in a future commit.
PR-URL: https://github.com/joyent/node/pull/8110
Signed-off-by: Trevor Norris <trev.norris@gmail.com>
Reviewed-by: Fedor Indutny <fedor@indutny.com>
Reviewed-by: Alexis Campailla <alexis@janeasystems.com>
Reviewed-by: Julien Gilli <julien.gilli@joyent.com>
Alexis Campailla [Fri, 7 Nov 2014 13:31:39 +0000 (14:31 +0100)]
test: mark current flaky tests as flaky
Alexis Campailla [Fri, 7 Nov 2014 13:15:24 +0000 (14:15 +0100)]
test: runner support for flaky tests
Adding --flaky-tests option, to allow regarding flaky tests failures
as non-fatal.
Currently only observed by the TapProgressIndicator, which will
add a # TODO directive to tests classified as flaky. According to the
TAP specification, the test harness is supposed to treat failures
that have a # TODO directive as non-fatal.
Trevor Norris [Thu, 4 Dec 2014 01:16:31 +0000 (17:16 -0800)]
node: fix bad assert
It was my mistake to change an assert check. This changes it back to how
the assert was originally done.
Fixes: c131c1f "modules: adding load linked modules feature"
Signed-off-by: Trevor Norris <trev.norris@gmail.com>
Carlos Campderrós [Thu, 31 Jul 2014 08:34:51 +0000 (10:34 +0200)]
doc: set logical umask in process.umask example
0644 seems to be the desired mode for new files (as it is a very weird
umask), and to achieve that the correct umask would be 0022.
PR-URL: https://github.com/joyent/node/pull/8039
Reviewed-by: Trevor Norris <trev.norris@gmail.com>
Jonathan Johnson [Thu, 27 Nov 2014 02:02:25 +0000 (20:02 -0600)]
url: change hostname regex to negate invalid chars
Regarding joyent/node#8520
This changes hostname validation from a whitelist regex approach
to a blacklist regex approach as described in https://url.spec.whatwg.org/#host-parsing.
url.parse misinterpreted `https://good.com+.evil.org/`
as `https://good.com/+.evil.org/`. If we use url.parse to check the
validity of the hostname, the test passes, but in the browser the
user is redirected to the evil.org website.
Trevor Norris [Wed, 3 Dec 2014 01:10:40 +0000 (17:10 -0800)]
lint: fix code style
Couple code style fixes to pass cpplint
Fixes: 304c0b4 "crypto: store thread id as pointer-sized"
Yazhong Liu [Thu, 20 Nov 2014 15:46:38 +0000 (23:46 +0800)]
url: support `path` for url.format
this adds support for a "path" field that overrides
"query", "search", and "pathname" if given.
Fixes: https://github.com/joyent/node/issues/8722
PR-URL: https://github.com/joyent/node/pull/8755
Reviewed-by: Chris Dickinson <christopher.s.dickinson@gmail.com>
Thorsten Lorenz [Mon, 15 Sep 2014 17:00:22 +0000 (12:00 -0500)]
modules: adding load linked modules feature
- introduced NM_F_LINKED flag to identify linked modules
- setting node_is_initialized after calling V8::Initialize in order to
make the right decision during initial module registration
- introduced modlist_linked in order to track modules that were
pre-registered in order to complete it once node is initialized
- completing registration of linked module similarly to the way it's
done inside DLOpen
PR-URL: https://github.com/joyent/node/pull/8386
Reviewed-by: Trevor Norris <trev.norris@gmail.com>
Alexis Campailla [Mon, 17 Nov 2014 15:44:19 +0000 (16:44 +0100)]
crypto: store thread id as pointer-sized
In https://github.com/MSOpenTech/libuv/commit/
59658a8de7cc05a58327a164fd2ed4b050f8b4f4
the return of uv_thread_self() was changed from unsigned long to
uv_thread_t.
uv_thread_t is a HANDLE (pointer-sized) on Windows, which means that
on Win64 it cannot be stored with CRYPTO_THREADID_set_numeric without
data loss.
Furthermore, without this change there will be a build break on Windows
when the libuv change is integrated into Node, because of the
conversion from HANDLE to unsigned long.
Other related commits:
https://github.com/joyent/node/commit/
5845a6bcd5b36168bdddeb85da8d8d9d36de7642
https://github.com/MSOpenTech/libuv/commit/
919d8ec63ac53566ad1f090058ec15966bd0e960
Alexis Campailla [Fri, 28 Nov 2014 12:11:36 +0000 (13:11 +0100)]
Revert "crypto: cast uv_thread_t to unsigned long"
This reverts commit
0308ad2ce53f73368f265d5e7ee4c0e9f07600a6.
Saúl Ibarra Corretgé [Wed, 26 Nov 2014 21:50:19 +0000 (22:50 +0100)]
crypto: cast uv_thread_t to unsigned long
Should work in all platforms and it fixes this compilation problem
on OSX:
../src/node_crypto.cc:154:3: error: no matching function for call to
'CRYPTO_THREADID_set_numeric'
CRYPTO_THREADID_set_numeric(tid, uv_thread_self());
^~~~~~~~~~~~~~~~~~~~~~~~~~~
../deps/openssl/openssl/include/openssl/../../crypto/crypto.h:435:6:
note: candidate function not viable: no known conversion from
'uv_thread_t' (aka '_opaque_pthread_t *') to 'unsigned long'
for 2nd argument
void CRYPTO_THREADID_set_numeric(CRYPTO_THREADID *id, unsigned
long val);
^
1 error generated.
PR-URL: https://github.com/joyent/node/pull/8785
Reviewed-by: Trevor Norris <trev.norris@gmail.com>
Saúl Ibarra Corretgé [Wed, 26 Nov 2014 21:37:41 +0000 (22:37 +0100)]
deps: update libuv to 1.0.1
PR-URL: https://github.com/joyent/node/pull/8785
Reviewed-by: Trevor Norris <trev.norris@gmail.com>
Vladimir Kurchatkin [Tue, 18 Nov 2014 09:30:27 +0000 (12:30 +0300)]
smalloc: don't allow to dispose typed arrays
PR-URL: https://github.com/joyent/node/pull/8743
Reviewed-by: Trevor Norris <trev.norris@gmail.com>
Nathan Woltman [Fri, 21 Nov 2014 08:22:07 +0000 (03:22 -0500)]
path: refactor normalizeArray()
The normalizeArray() function now avoids using the slow Array#splice()
method to improve performance and now also filters out empty path parts.
Code that pre-filtered empty parts has been removed.
PR-URL: https://github.com/joyent/node/pull/8724
Reviewed-by: Trevor Norris <trev.norris@gmail.com>
Saúl Ibarra Corretgé [Fri, 21 Nov 2014 14:43:12 +0000 (15:43 +0100)]
deps: update libuv to 1.0.0
PR-URL: https://github.com/joyent/node/pull/8762
Reviewed-by: Trevor Norris <trev.norris@gmail.com>
Rory Bradford [Tue, 8 Apr 2014 21:48:24 +0000 (22:48 +0100)]
path: added parse() and format() functions
The parse() function splits a path and returns an object
with the different elements. The format() function is the
reverse of this and adds an objects corresponding path
elements to make up a string. Fixes #6976.
Fixes: https://github.com/joyent/node/issues/6976
PR-URL: https://github.com/joyent/node/pull/8750
Reviewed-by: Julien Gilli <julien.gilli@joyent.com>
Timothy J Fontaine [Tue, 11 Jun 2013 00:09:54 +0000 (17:09 -0700)]
path: allow calling platform specific methods
Add path.posix and path.win32 which have the specific methods like
resolve and normalize so you can specifically normalize or resolve
based on the target platform.
PR-URL: https://github.com/joyent/node/pull/5661
Reviewed-by: Chris Dickinson <christopher.s.dickinson@gmail.com>
Steve Sharp [Thu, 20 Nov 2014 18:35:30 +0000 (10:35 -0800)]
doc: correct broken link in net.markdown
Fixes broken link to Readable Stream documentation.
Fixes: https://github.com/joyent/node/issues/8464
PR-URL: https://github.com/joyent/node/pull/8756
Reviewed-by: Chris Dickinson <christopher.s.dickinson@gmail.com>
MK Safi [Wed, 14 Aug 2013 23:15:49 +0000 (02:15 +0300)]
doc: clarify return value of http.createServer
PR-URL: https://github.com/joyent/node/pull/6054
Reviewed-by: Isaac Z. Schlueter <i@izs.me>
Reviewed-by: Chris Dickinson <christopher.s.dickinson@gmail.com>
Artur Cistov [Fri, 15 Feb 2013 22:21:48 +0000 (22:21 +0000)]
doc: fix typos in http.markdown
PR-URL: https://github.com/joyent/node/pull/4784
Reviewed-by: Chris Dickinson <christopher.s.dickinson@gmail.com>
Chris Dickinson [Sun, 16 Nov 2014 02:33:20 +0000 (18:33 -0800)]
dns: propagate domain for c-ares methods
Fixes: https://github.com/joyent/node/issues/5471
PR-URL: https://github.com/joyent/node/pull/8732
Reviewed-by: Trevor Norris <trev.norris@gmail.com>
Sam Roberts [Wed, 8 Oct 2014 21:36:21 +0000 (14:36 -0700)]
process: pid can be a string in process.kill()
Not allowing string was a change from v0.10 behaviour, commented on in
joyent/node#7991. Allow them again, but still check that argument is
numberish. Also, simplify the fragile and non-portable test code
introduced in
832ec1cd507 that required fixups
2a415358ee, and
ef3c4ed3d.
PR-URL: https://github.com/joyent/node/pull/8531
Reviewed-by: Trevor Norris <trev.norris@gmail.com>
Vladimir Kurchatkin [Sat, 1 Nov 2014 10:07:03 +0000 (13:07 +0300)]
fs: fix symlink error message
the arguments were swapped, so fs.symlink{Sync,} would
report that the wrong file EEXIST'd in error.
Fixes: https://github.com/joyent/node/issues/8651
Fixes: https://github.com/joyent/node/issues/4314
Fixes: https://github.com/joyent/node/issues/5381
PR-URL: https://github.com/joyent/node/pull/8657
Reviewed-by: Chris Dickinson <christopher.s.dickinson@gmail.com>
haoxin [Tue, 9 Sep 2014 02:22:37 +0000 (10:22 +0800)]
module: correct the order of the assertions
this puts the type-checking assertions in require
into proper order.
PR-URL: https://github.com/joyent/node/pull/8333
Reviewed-by: Chris Dickinson <christopher.s.dickinson@gmail.com>
Reviewed-by: Fedor Indutny <fedor@indutny.com>
Steven Loomis [Tue, 5 Aug 2014 01:00:55 +0000 (21:00 -0400)]
build: i18n: support little-endian machines
Note that this may not affect anything until powerpc support lands in
v8.
Related: https://github.com/srl295/node/issues/7
Related: https://github.com/srl295/node/commit/
ba8ab91bc4762ade646474276c4a4b8cdaf83115
PR-URL: https://github.com/joyent/node/pull/8712
Reviewed-by: Trevor Norris <trev.norris@gmail.com>
Steven R. Loomis [Thu, 6 Nov 2014 03:09:43 +0000 (19:09 -0800)]
build: i18n: fix icu toolset dependencies
So what I did here is to make the icutools library actually contain the
entire ICU dependencies needed for host-side tools. Sadly, this will
build ICU twice, but avoids conflicts between host and target side.
This all seems like a gyp bug of some sort, but without docs for
toolsets, who’s to say?
I removed the icuio library as a separate target, because it was only
used by the host-side tools.
PR-URL: https://github.com/joyent/node/pull/8681
Reviewed-by: Trevor Norris <trev.norris@gmail.com>
Steven R. Loomis [Sat, 4 Oct 2014 06:10:29 +0000 (23:10 -0700)]
build: i18n: fix build on OSX
Fix config option that doesn't work with OSX.
Fixes: https://github.com/joyent/node/issues/8521
PR-URL: https://github.com/joyent/node/pull/8602
Reviewed-by: Trevor Norris <trev.norris@gmail.com>
sudodoki [Mon, 16 Jun 2014 22:05:58 +0000 (01:05 +0300)]
doc: note ability to require files within packages
Adding note to api/modules.markdown about ability to
load arbitrary path from modules from node_module path
by adding reference to path after module name in call
to require()
PR-URL: https://github.com/joyent/node/pull/7794
Reviewed-by: Trevor Norris <trev.norris@gmail.com>
Reviewed-by: Fedor Indutny <fedor@indutny.com>
Reviewed-by: Timothy J Fontaine <tjfontaine@gmail.com>
Jackson Tian [Mon, 10 Nov 2014 05:09:58 +0000 (13:09 +0800)]
tls: remove tls.createSecurePair code deprecation
In https://github.com/joyent/node/pulls/8695, the deprecation was
removed from doc. This removes the deprecation from the code.
PR-URL: https://github.com/joyent/node/pull/8700
Reviewed-by: Chris Dickinson <christopher.s.dickinson@gmail.com>
Chris Dickinson [Fri, 7 Nov 2014 22:24:12 +0000 (14:24 -0800)]
doc: remove tls.createSecurePair deprecation
pending tls.TLSSocket growing the ability to work
with streams, createSecurePair will remain.
PR-URL: https://github.com/joyent/node/pull/8695
Reviewed-by: Fedor Indutny <fedor@indutny.com>
Trevor Norris [Fri, 7 Nov 2014 21:44:09 +0000 (13:44 -0800)]
uv: revert change causing build failures
Revert uv_thread_self() to return unsigned long instead of uv_thread_t.
This was causing a build failure on Windows and is only a temporary fix
until the proper patch lands upstream.
Reverts: https://github.com/joyent/libuv/commit/
59658a8
Fixes: ce112c2 "deps: update uv to v1.0.0-rc2"
Saúl Ibarra Corretgé [Fri, 17 Oct 2014 07:31:59 +0000 (09:31 +0200)]
core: fix usage of uv_cwd
It was modified in libuv to be consistent with uv_exepath and not
include the trailing NULL byte in the returned size.
PR-URL: https://github.com/joyent/node/pull/8566
Reviewed-by: Fedor Indutny <fedor@indutny.com>
Reviewed-by: Trevor Norris <trev.norris@gmail.com>
Saúl Ibarra Corretgé [Fri, 17 Oct 2014 07:31:23 +0000 (09:31 +0200)]
core: replace uv_fs_readdir with uv_fs_scandir
PR-URL: https://github.com/joyent/node/pull/8566
Reviewed-by: Fedor Indutny <fedor@indutny.com>
Reviewed-by: Trevor Norris <trev.norris@gmail.com>
Saúl Ibarra Corretgé [Mon, 20 Oct 2014 22:45:30 +0000 (00:45 +0200)]
deps: update uv to v1.0.0-rc2
PR-URL: https://github.com/joyent/node/pull/8566
Reviewed-by: Fedor Indutny <fedor@indutny.com>
Reviewed-by: Trevor Norris <trev.norris@gmail.com>
Timothy J Fontaine [Tue, 4 Nov 2014 23:08:12 +0000 (15:08 -0800)]
npm: Upgrade to v2.1.6
Forrest L Norvell [Wed, 24 Sep 2014 01:59:35 +0000 (18:59 -0700)]
test: more thorough tests for npm
Julien Gilli [Thu, 9 Oct 2014 20:01:27 +0000 (13:01 -0700)]
build: fix build for SmartOS
This change in V8: https://code.google.com/p/v8/source/detail?r=22210
has introduced a method named OS::GetCurrentThreadId which fails to
compile on OSes where a "gettid" syscall does not exist.
This build issue has been fixed upstream by several changes:
- https://code.google.com/p/v8/source/detail?r=23459.
- https://codereview.chromium.org/
649553002
- https://codereview.chromium.org/
642223003
Another minor fix to the upstream changes was also necessary.
See https://code.google.com/p/v8/issues/detail?id=3620 for
more information.
The other build issue was due to the fact that alloca.h is not included
by other system includes on SmartOS, which is assumed by V8.
Built and tested on Linux, MacOS X, Windows and SmartOS.
Vladimir Kurchatkin [Fri, 31 Oct 2014 22:15:12 +0000 (01:15 +0300)]
smalloc: check if obj has external data
PR-URL: https://github.com/joyent/node/pull/8655
Reviewed-by: Trevor Norris <trev.norris@gmail.com>
Vladimir Kurchatkin [Tue, 28 Oct 2014 12:32:07 +0000 (15:32 +0300)]
smalloc: fix copyOnto optimization
copyOnto is broken when one argument has 1 byte size and the other > 1
byte.
PR-URL: https://github.com/joyent/node/pull/8637
Reviewed-by: Trevor Norris <trev.norris@gmail.com>
cjihrig [Sat, 18 Oct 2014 01:45:40 +0000 (21:45 -0400)]
net: add pauseOnConnect option to createServer()
Currently when a server receives a new connection the underlying socket
handle begins reading data immediately. This causes problems when
sockets are passed between processes, as data can be read by the first
process and thus never read by the second process.
This commit allows sockets that are constructed with a handle to be
paused initially.
PR-URL: https://github.com/joyent/node/pull/8576
Fixes: https://github.com/joyent/node/issues/7905
Fixes: https://github.com/joyent/node/issues/7784
Reviewed-by: Trevor Norris <trev.norris@gmail.com>
Vladimir Kurchatkin [Tue, 21 Oct 2014 09:00:37 +0000 (13:00 +0400)]
docs: fix smalloc.dispose() example
Also couple of additions about dispose and limitations of smalloc'ed
objects.
Fixes: https://github.com/joyent/node/pull/8625
Reviewed-by: Trevor Norris <trev.norris@gmail.com>
Trevor Norris [Sat, 25 Oct 2014 21:27:23 +0000 (14:27 -0700)]
lint: fix whitespace issues
Fixes: f6e5740 "path: resolve normalize drive letter to lower case"
Signed-off-by: Trevor Norris <trev.norris@gmail.com>
dead-horse [Wed, 17 Sep 2014 10:59:59 +0000 (18:59 +0800)]
path: resolve normalize drive letter to lower case
make path.resolve work the same as path.normalize
Alexis Campailla [Fri, 10 Oct 2014 13:14:47 +0000 (15:14 +0200)]
build: vcbuild fix "The input line is too long."
vcbuild.bat is calling vcvars.bat, which doesn't detect if the environment
has already been set. This causes repeated entries to be added to the PATH,
which after a few invocations will lead to an error:
The input line is too long.
Brian White [Thu, 9 Oct 2014 20:07:50 +0000 (16:07 -0400)]
streams: make setDefaultEncoding() throw
PR-URL: https://github.com/joyent/node/pull/8529
Fixes: f04f3a0 "streams: set default encoding for writable streams"
[trev.norris@gmail.com: update tests to check if throws]
Signed-off-by: Trevor Norris <trev.norris@gmail.com>
Wang Xinyong [Thu, 9 Oct 2014 17:15:05 +0000 (01:15 +0800)]
doc: correct createSecureContext
Remove incorrect stablity indication of tls.createSecureContext, and
format stablity indication of crypto.createCredentials.
Fixes: e50749 "doc: document `tls.createSecureContext`"
Reviewed-by: Trevor Norris <trev.norris@gmail.com>
Alexis Campailla [Wed, 8 Oct 2014 18:30:01 +0000 (20:30 +0200)]
test: fix test-child-process-spawn-typeerror
You cannot spawn 'dir' on Windows because it's not an executable. Also,
some people might have 'ls' on their path on Windows, so I changed
invalidCmd to something that's highly unlikely to exist.
Reviewed-by: Trevor Norris <trev.norris@gmail.com>
Stiliyan Lazarov [Sat, 4 Oct 2014 14:50:50 +0000 (10:50 -0400)]
doc: fix wording and punctuation in modules
[trev.norris@gmail.com: break lines at 80 characters]
Signed-off-by: Trevor Norris <trev.norris@gmail.com>
Trevor Norris [Wed, 8 Oct 2014 22:38:46 +0000 (15:38 -0700)]
crypto: createDiffieHellman throw for bad args
Previously crypto.createDiffieHellman() would fail silently when a bad
argument was passed for prime/prime_length. Now throws TypeError.
Fixes: https://github.com/joyent/node/issues/8480
Signed-off-by: Trevor Norris <trev.norris@gmail.com>
Fedor Indutny [Wed, 8 Oct 2014 10:35:07 +0000 (14:35 +0400)]
test: fix debug-signal-cluster after da update
The cluster children are hitting breakpoint at `cluster.onread` and
hanging on a Semaphore wait now. This prevents them from disconnecting
gracefully. Considering that the test is checking different thing, the
cluster children needs to be force killed from the grand parent process.
Reviewed-By: Trevor Norris <trevnorris@gmail.com>
PR-URL: https://github.com/joyent/node/pull/8476
Fedor Indutny [Wed, 8 Oct 2014 10:34:51 +0000 (14:34 +0400)]
src, test: fixup after v8 update
Because of behavior change of some V8 APIs (they mostly became more
strict), following modules needed to be fixed:
* crypto: duplicate prototype methods are not allowed anymore
* contextify: some TryCatch trickery, the binding was using it
incorrectly
* util: maximum call stack error is now crashing in a different place
Reviewed-By: Trevor Norris <trevnorris@gmail.com>
PR-URL: https://github.com/joyent/node/pull/8476
Fedor Indutny [Sat, 4 Oct 2014 14:44:46 +0000 (18:44 +0400)]
cluster: do not signal children in debug mode
Do not send signal to children if they are already in debug mode.
Node.js on Windows does not register signal handler, and thus calling
`process._debugProcess()` will throw an error.
Reviewed-By: Trevor Norris <trevnorris@gmail.com>
PR-URL: https://github.com/joyent/node/pull/8476
Fedor Indutny [Sat, 4 Oct 2014 14:44:39 +0000 (18:44 +0400)]
deps: re-implement debugger-agent
Reviewed-By: Trevor Norris <trevnorris@gmail.com>
PR-URL: https://github.com/joyent/node/pull/8476
Refael Ackermann [Mon, 29 Sep 2014 09:20:50 +0000 (13:20 +0400)]
deps: fix postmortem-metadata generator in v8
Reviewed-By: Fedor Indutny <fedor@indutny.com>
PR-URL: https://github.com/joyent/node/pull/8476
Fedor Indutny [Thu, 2 Oct 2014 04:16:24 +0000 (08:16 +0400)]
deps: apply floating irhydra patch to v8
Reviewed-By: Fedor Indutny <fedor@indutny.com>
PR-URL: https://github.com/joyent/node/pull/8476
Refael Ackermann [Mon, 29 Sep 2014 09:20:04 +0000 (13:20 +0400)]
deps: update v8 to 3.28.73
Reviewed-By: Fedor Indutny <fedor@indutny.com>
PR-URL: https://github.com/joyent/node/pull/8476
Fedor Indutny [Mon, 6 Oct 2014 12:23:01 +0000 (16:23 +0400)]
tls_wrap: ignore ZERO_RETURN after close_notify
Do not call SSL_read() and ignore ZERO_RETURN if the connection was
shutdown and there could not be any reads.
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
PR-URL: https://github.com/joyent/node/pull/8519
Trevor Norris [Wed, 8 Oct 2014 09:08:54 +0000 (02:08 -0700)]
buffer, doc: misc. fix and cleanup
* Add official documentation that a Buffer instance is a viable
argument when instantiating a new Buffer.
* Properly set the poolOffset when a buffer needs to be truncated.
* Add comments clarifying specific peculiar coding choices.
* Remove a level of unnecessary indentation.
Signed-off-by: Trevor Norris <trev.norris@gmail.com>
Trevor Norris [Wed, 8 Oct 2014 08:34:46 +0000 (01:34 -0700)]
src: update use of ExternalArrayType constants
Continuation of
4809c7a to update the use of v8::ExternalArrayType.
Signed-off-by: Trevor Norris <trev.norris@gmail.com>
Refael Ackermann [Thu, 2 Oct 2014 08:20:51 +0000 (11:20 +0300)]
tools: fix for testing openssl integrations
Windows doesn't resolve ".." the way we expect it for symlinks and
junctions.
PR-URL: https://github.com/joyent/node/pull/8489
Reviewed-by: Trevor Norris <trev.norris@gmail.com>
Reviewed-by: Fedor Indutny <fedor@indutny.com>
Trevor Norris [Wed, 8 Oct 2014 08:13:43 +0000 (01:13 -0700)]
src: fix jslint warning
Signed-off-by: Trevor Norris <trev.norris@gmail.com>
Trevor Norris [Wed, 8 Oct 2014 08:06:06 +0000 (01:06 -0700)]
smalloc: update use of ExternalArrayType constants
The constants in enum v8::ExternalArrayType have been changed. The old
values are there for legacy reasons, but it's best to update anyway.
Signed-off-by: Trevor Norris <trev.norris@gmail.com>
Steve Mao [Fri, 3 Oct 2014 05:53:15 +0000 (15:53 +1000)]
doc: add missing semicolons
PR-URL: https://github.com/joyent/node/pull/8498
Reviewed-by: Trevor Norris <trev.norris@gmail.com>
Johnny Ray [Tue, 7 Oct 2014 23:32:05 +0000 (16:32 -0700)]
streams: set default encoding for writable streams
Add API Writable#setDefaultEncoding().
PR-URL: https://github.com/joyent/node/pull/8483
Fixes: https://github.com/joyent/node/issues/7159
Reviewed-by: Trevor Norris <trev.norris@gmail.com>
Steven R. Loomis [Sat, 4 Oct 2014 05:41:05 +0000 (22:41 -0700)]
build: i18n: py27 -> py26 dependency
Move from argparse to optparse for dependency management.
Fixes: https://github.com/joyent/node/pull/7719#issuecomment-56868172
Reviewed-by: Trevor Norris <trev.norris@gmail.com>
Steven R. Loomis [Sat, 4 Oct 2014 00:42:37 +0000 (17:42 -0700)]
build: i18n: move noisy variables to separate gypi
Fixes: https://github.com/joyent/node/issues/7676#issuecomment-57535890
Reviewed-by: Trevor Norris <trev.norris@gmail.com>
Evan Rutledge Borden [Fri, 26 Sep 2014 15:59:39 +0000 (11:59 -0400)]
url: fixed encoding for slash switching emulation.
Fixes: https://github.com/joyent/node/issues/8458
Reviewed-by: Trevor Norris <trev.norris@gmail.com>
Reviewed-by: Chris Dickinson <christopher.s.dickinson@gmail.com>
Victor Widell [Sun, 30 Mar 2014 10:34:45 +0000 (12:34 +0200)]
doc: improve readLine.pause()
The docs for readLine.pause are misleading. I seriously spent hours on this. If
it isn't a bug, at least it should be well documented.
Someone else stumbled on this too:
http://stackoverflow.com/questions/
21341050/pausing-readline-in-node-js
Reviewed-by: Trevor Norris <trev.norris@gmail.com>
Reviewed-by: Chris Dickinson <christopher.s.dickinson@gmail.com>
Steve Sharp [Sun, 28 Sep 2014 23:03:25 +0000 (16:03 -0700)]
doc: Update net.markdown
Associates link to dns.lookup() with proper URL.
Fixes: https://github.com/joyent/node/issues/8018
Reviewed-by: Trevor Norris <trev.norris@gmail.com>
Reviewed-by: Chris Dickinson <christopher.s.dickinson@gmail.com>
gyson [Wed, 1 Oct 2014 02:44:39 +0000 (10:44 +0800)]
util: add es6 Symbol support for `util.inspect`
* `util.inspect` cannot accept es6 symbol primitive
* It will throw exception if do `util.inspect(Symbol())`
* This also affects repl, console.log, etc.
Reviewed-by: Trevor Norris <trev.norris@gmail.com>
Reviewed-by: Chris Dickinson <christopher.s.dickinson@gmail.com>
Yazhong Liu [Thu, 2 Oct 2014 23:24:58 +0000 (16:24 -0700)]
buffer: add generic functions for (u)int ops
Add generic functions for (U)Int read/write operations on Buffers. These
support up to and including 48 bit reads and writes.
Include documentation and tests.
Additional work done by Trevor Norris to include 40 and 48 bit write
support. Because bitwise operations cannot be used on values greater
than 32 bits, the operations have been replaced with mathematical
calculations. Regardless, they are still faster than floating point
operations.
Reviewed-by: Trevor Norris <trev.norris@gmail.com>
Trevor Norris [Wed, 1 Oct 2014 22:42:02 +0000 (15:42 -0700)]
buffer: mv floating point read/write checks to JS
Performance improvement by moving checks for floating point operations
to JS and doing the operation on a protected internal function that
assumes all arguments are correct. Still abort if the operation
overflows memory. This can only be caused if the Buffer's length
property isn't the same as the actual internal length.
Signed-off-by: Trevor Norris <trev.norris@gmail.com>
Julien Gilli [Mon, 22 Sep 2014 20:21:11 +0000 (13:21 -0700)]
readline: should not require an output stream.
Passing null as the output stream to readline.Interface()'s constructor
is now supported. Any output written by readline is just discarded. It
makes it easier to use readline just as a line parser.
Fixes: https://github.com/joyent/node/issues/4408
Reviewed-by: Trevor Norris <trev.norris@gmail.com>
Vladimir Kurchatkin [Mon, 22 Sep 2014 16:19:50 +0000 (20:19 +0400)]
node: avoid automatic microtask runs
Since we are taking control of the microtask queue it makes sense to
disable autorun and only run microtasks when necessary. Just setting
isolate->SetAutorunMicrotasks(false) would cause _tickCallback() not to
be called.
Automatically running the microtask queue will cause it to run:
* After callback invocation
* Inside _tickCallback()
* After _tickCallback() invocation
The third one is unnecessary as the microtask queue is guaranteed to be
empty at this point. The first only needs to be run manually when
_tickCallback() isn't going to be called by MakeCallback().
Reviewed-by: Trevor Norris <trev.norris@gmail.com>
Gabriel Wicke [Thu, 25 Sep 2014 16:59:18 +0000 (09:59 -0700)]
url: make query() consistent
Match the behavior of the slow path by setting url.query to an empty
object when the url contains no query, but query parsing is requested.
Also add a test for this case, and update the documents to clearly
reflect this behavior.
Fixes: https://github.com/joyent/node/issues/8332
Reviewed-by: Trevor Norris <trev.norris@gmail.com>
Steven R. Loomis [Fri, 5 Sep 2014 05:03:24 +0000 (22:03 -0700)]
build, i18n: improve Intl build, add "--with-intl"
The two main goals of this change are:
- To make it easier to build the Intl option using ICU (particularly,
using a newer ICU than v8/Chromium's version)
- To enable a much smaller ICU build with only English support The goal
here is to get node.js binaries built this way by default so that the
Intl API can be used. Additional data can be added at execution time
(see Readme and wiki)
More details are at https://github.com/joyent/node/pull/7719
In particular, this change adds the "--with-intl=" configure option to
provide more ways of building "Intl":
- "full-icu" picks up an ICU from deps/icu
- "small-icu" is similar, but builds only English
- "system-icu" uses pkg-config to find an installed ICU
- "none" does nothing (no Intl)
For Windows builds, the "full-icu" or "small-icu" options are added to
vcbuild.bat.
Note that the existing "--with-icu-path" option is not removed from
configure, but may not be used alongside the new option.
Wiki changes have already been made on
https://github.com/joyent/node/wiki/Installation
and a new page created at
https://github.com/joyent/node/wiki/Intl
(marked as provisional until this change lands.)
Summary of changes:
* README.md : doc updates
* .gitignore : added "deps/icu" as this is the location where ICU is
unpacked to.
* Makefile : added the tools/icu/* files to cpplint, but excluded a
problematic file.
* configure : added the "--with-intl" option mentioned above.
Calculate at config time the list of ICU source files to use and data
packaging options.
* node.gyp : add the new files src/node_i18n.cc/.h as well as ICU
linkage.
* src/node.cc : add call into
node::i18n::InitializeICUDirectory(icu_data_dir) as well as new
--icu-data-dir option and NODE_ICU_DATA env variable to configure ICU
data loading. This loading is only relevant in the "small"
configuration.
* src/node_i18n.cc : new source file for the above Initialize..
function, to setup ICU as needed.
* tools/icu : new directory with some tools needed for this build.
* tools/icu/icu-generic.gyp : new .gyp file that builds ICU in some new
ways, both on unix/mac and windows.
* tools/icu/icu-system.gyp : new .gyp file to build node against a
pkg-config detected ICU.
* tools/icu/icu_small.json : new config file for the "English-only" small
build.
* tools/icu/icutrim.py : new tool for trimming down ICU data. Reads the
above .json file.
* tools/icu/iculslocs.cc : new tool for repairing ICU data manifests
after trim operation.
* tools/icu/no-op.cc : dummy file to force .gyp into using a C++ linker.
* vcbuild.bat : added small-icu and full-icu options, to call into
configure.
* Fixed toolset dependencies, see
https://github.com/joyent/node/pull/7719#issuecomment-
54641687
Note that because of a bug in gyp {CC,CXX}_host must also be set.
Otherwise gcc/g++ will be used by default for part of the build.
Reviewed-by: Trevor Norris <trev.norris@gmail.com>
Reviewed-by: Fedor Indutny <fedor@indutny.com>
Julien Fontanet [Tue, 23 Sep 2014 14:51:33 +0000 (16:51 +0200)]
doc: note stdout and stderr special behaviors.
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
Reviewed-By: Chris Dickinson <christopher.s.dickinson@gmail.com>