EMFILE and ENFILE mean 'out of file descriptors'. It's a run-time error
and as such should emit an error on the child process object, not throw
an exception.
Fixes#7453.
Signed-off-by: Timothy J Fontaine <tjfontaine@gmail.com>
Avoid sending unsent data and destroying otherwise legitimate sockets
for requests that are aborted while still in the agent queue. This
reduces stress on upstream systems who will likely respond to the
request but client app already knows that it will be dropped on the
floor and also helps avoid killing keep-alive connections.
See also commit e7bfbaf. Don't depend on deps/v8/build/features.gypi
to disable handle zapping, be explicit about it.
Signed-off-by: Timothy J Fontaine <tjfontaine@gmail.com>
Not all querystring are utf-8 encoding, make querystring can be used
to encode / decode `non-utf8` encoding string if necessary.
Signed-off-by: Timothy J Fontaine <tjfontaine@gmail.com>
Do not ever call `Delete()` on `proxy_global_`, it will invoke
`GlobalPropertyDeleteCallback` and cause crash because of the infinite
recursion.
fix#7529
64bit constants are keyed for x64 platforms only, add PowerPC based
platform constants.
Node's "ucs2" encoding wants LE character data stored in the Buffer, so
we need to reorder on BE platforms. See
http://nodejs.org/api/buffer.html regarding Node's "ucs2" encoding
specification
Signed-off-by: Timothy J Fontaine <tjfontaine@gmail.com>
Storing it in SSL_CTX is incorrect as it may go away and get destructed
earlier, also it'll yield invalid results in SelectSNIContextCallback.
Use `SSL_get_app_data()` instead.
fix#7484
Signed-off-by: Timothy J Fontaine <tjfontaine@gmail.com>
The spawnsync test was written wrong, the timeout can never fire before
the sync process has returned, the delta is immaterial and times when
it was succeeding are not reliable cases.
Instead verify that the timeout doesn't fire while the sync process is
happening.
When close() is called on a non-listening server, a synchronous
error is thrown. This commit causes the error to be passed to
the asynchronous callback function instead.
Signed-off-by: Fedor Indutny <fedor@indutny.com>
stringToFlags() has fall throughs in a case statement.
However, they are not consistently implemented. This commit adds
consistency.
Signed-off-by: Trevor Norris <trev.norris@gmail.com>
There was an underlying assumption in readline.emitKeypressEvents (and
by extension emitKey) that the given stream (usually process.stdin)
would emit 'data' once per keypress, which is not always the case.
This commit buffers the input stream and ensures a 'keypress' event is
triggered for every keypress (including escape codes).
Signed-off-by: Fedor Indutny <fedor@indutny.com>
This test is still in test/disabled because it requires a tty, however
when executed directly this test now passes.
Signed-off-by: Fedor Indutny <fedor@indutny.com>
A recent change to v8's API now makes it impossible to memcpy to a
v8::ArrayBuffer without causing it to be externalized. This means that
the garbage collector will not automatically free the memory when the
object is collected.
When/If the necessary API is included to allow the above
Buffer#toArrayBuffer() will be reintroduced.
Signed-off-by: Timothy J Fontaine <tjfontaine@gmail.com>
Not removing 'end' listeners for input and output on the 'close' event
resulted in an EventEmitter related memory leak.
This issue also might be reproduced at:
https://github.com/npm/npm/issues/5203
Signed-off-by: Trevor Norris <trev.norris@gmail.com>
When process._setupNextTick() was introduced as the means to properly
initialize the mechanism behind process.nextTick() a chunk of code was
left behind that assigned memory to process._tickInfo. This code is no
longer needed.
See https://code.google.com/p/chromium/issues/detail?id=25916
Parse URLs with backslashes the same as web browsers, by replacing all
backslashes with forward slashes, except those that occur after the
first # character.
Manual rebase of 9520ade
Signed-off-by: Trevor Norris <trev.norris@gmail.com>
On windows you can see ECONNABORTED instead of ECONNRESET in various
scenarios, and they are both applicable we're testing that Node is not
swallowing these errors which it was known to do prior to 0.10
As a comment in the test states: "This test should not be ported to
v0.10 and higher, because the problem is fixed by not ignoring
ECONNRESET in the first place."
The test is checking whether write returns false instead of whether an
ECONNRESET has been raised.
Replace with test-http-destroyed-socket-write2, this test verifies that
ECONNRESET is raised when writing to an http request where the server
has destroyed the socket.
Signed-off-by: Timothy J Fontaine <tjfontaine@gmail.com>
On Windows we cannot get the server address until a connection
is accepted.
From MSDN:
The getsockname function does not always return information about
the host address when the socket has been bound to an unspecified
address, unless the socket has been connected with connect or accept
(for example, using ADDR_ANY). A Windows Sockets application must not
assume that the address will be specified unless the socket is
connected.
Signed-off-by: Timothy J Fontaine <tjfontaine@gmail.com>
* Check SHA before using files from cache
* adduser: allow change of the saved password
* Make `npm install` respect `config.unicode`
* Fix lifecycle to pass `Infinity` for config env value
* Don't return 0 exit code on invalid command
* cache: Handle 404s and other HTTP errors as errors
* bump tap dep, make tests stderr a bit quieter
* Resolve ~ in path configs to env.HOME
* Include npm version in default user-agent conf
* npm init: Use ISC as default license, use save-prefix for deps
* Many test and doc fixes
Because of differences in memcmp() implementation, normalize output to
return -1, 0 or 1 only.
Signed-off-by: Timothy J Fontaine <tjfontaine@gmail.com>