Commit Graph

9791 Commits (d0ff900a65e4250ad49dcf02e07262af1fa5de25)

Author SHA1 Message Date
Fedor Indutny d0ff900a65 node: fix exported signatures of MakeCallback
fix #7302
2014-03-13 21:14:54 +04:00
Fedor Indutny 0c5a0ecc7c deps: allow allocations in gc epilogue/prologue
See https://codereview.chromium.org/177243012/
2014-03-13 20:56:56 +04:00
Fedor Indutny 030d03190f deps: backport a6fed7c5 from v8's trunk 2014-03-13 20:56:55 +04:00
Fedor Indutny ce04c726a3 src: update to v8 3.24 APIs 2014-03-13 20:56:55 +04:00
Fedor Indutny 1c7bf245dc deps: update v8 to 3.24.40 2014-03-13 20:56:54 +04:00
Yazhong Liu 93c3674ff7 readline: consider newlines for cursor position
Fixes #7266.
Closes #7279.
2014-03-12 14:47:17 -03:00
Timothy J Fontaine 9bd934cb96 Now working on 0.11.13 2014-03-12 07:56:42 -07:00
Timothy J Fontaine 44bf5f8c50 Merge branch 'v0.11.12-release' 2014-03-12 07:56:30 -07:00
Timothy J Fontaine 7d6b8db40f src: accommodate uv_cwd including null on win32 2014-03-11 14:49:48 -07:00
Timothy J Fontaine 0c2e28d68f 2014.03.11, Version 0.11.12 (Unstable)
* uv: Upgrade to v0.11.22 (Timothy J Fontaine)

* buffer: allow toString to accept Infinity for end (Brian White)

* child_process: add spawnSync/execSync (Bert Belder, Timothy J Fontaine)

* cluster: handle bind errors on Windows (Alexis Campailla)

* contextify: handle infinite recursion errors (Fedor Indutny)

* crypto: allow custom generator for DiffieHellman (Brian White)

* crypto: allow setting add'l authenticated data (Brian White)

* crypto: fix CipherFinal return value check (Brian White)

* crypto: make NewSessionDoneCb public (Fedor Indutny)

* dgram: pass the bytes sent to the send callback (Timothy J Fontaine)

* dns: validate arguments in resolver (Kenan Sulayman)

* dns: verify argument is valid function in resolve (Kenan Sulayman)

* http: avoid duplicate keys in writeHead (David Björklund)

* net: add localPort to connect options (Timothy J Fontaine)

* node: do not print SyntaxError hints to stderr (Fedor Indutny)

* node: invoke `beforeExit` again if loop was active (Fedor Indutny)

* node: make AsyncListenerInst field more explicit (Trevor Norris)

* os: networkInterfaces include scopeid for ipv6 (Xidorn Quan)

* process: allow changing `exitCode` in `on('exit')` (Fedor Indutny)

* readline: fix `line` event, if input emit 'end' (Yazhong Liu)

* src: add tracing.v8.on('gc') statistics hooks (Ben Noordhuis)

* src: add v8.getHeapStatistics() function (Ben Noordhuis)

* src: emit 'beforeExit' event on process object (Ben Noordhuis)

* src: move AsyncListener from process to tracing (Trevor Norris)

* tls: fix crash in SNICallback (Fedor Indutny)

* tls: introduce asynchronous `newSession` (Fedor Indutny)

* util: show meaningful values for boxed primitives (Nathan Rajlich)

* vm: don't copy Proxy object from parent context (Ben Noordhuis)

* windows: make stdout/sterr pipes blocking (Alexis Campailla)

* zlib: add sync versions for convenience methods (Nikolai Vavilov)
2014-03-11 13:49:52 -07:00
Bryan Cantrill e496707d39 mdb_v8: update to latest version
* ::jsstack -v prints function defintion
 * ::jsprint works with objects with only numeric properties
 * update tests to use builtin mdb_v8
 * add more symbols to postmortem script - pending upstream
   inclusion
2014-03-10 19:12:14 -07:00
Timothy J Fontaine e2fcfea46e src: update from uv_read2_start removal
Previously if you wanted to be notified of pending handles for pipes
you needed to use uv_read2_start, however in v0.11.22 you can query for
pending handles independently.
2014-03-10 17:51:47 -07:00
Saúl Ibarra Corretgé d2f2a32b89 src: adapt to API change in uv_cwd 2014-03-10 17:01:47 -07:00
Timothy J Fontaine e92d35d80b uv: Upgrade to v0.11.22 2014-03-10 17:01:21 -07:00
Timothy J Fontaine b444392a98 Merge remote-tracking branch 'upstream/v0.10'
Conflicts:
	src/node.cc
	src/node.js
	test/message/max_tick_depth_trace.out
2014-03-10 16:50:00 -07:00
Shuhei Kagawa 43a29f53ca doc: remove an unused arg in process.stdin.
The argument of process.stdin's readable event handler is not used.
2014-03-10 15:30:40 -07:00
Fedor Indutny f0d870501e crypto: do not lowercase cipher/hash names
`crypto.getCiphers()` and `crypto.getHashes()` should prefer lower-case
variants of names, but should not introduce them.

fix #7282
2014-03-11 01:08:43 +04:00
Timothy J Fontaine a18c9b7dde test: timers-ordering should be more precise
Internally we use hrtime to schedule when a timer will fire, to avoid
the perils of clock drift or other external operation making time go
backward. The timers ordering test should use the same timing mechanism
2014-03-10 14:01:24 -07:00
Vladimir Kurchatkin e108ff4da7 buffer: fix typo in `SlowBuffer` 2014-03-10 13:23:56 -07:00
Brian White 68bfa91af7 buffer: allow toString to accept Infinity for end 2014-03-10 13:20:28 -07:00
Ben Noordhuis 6bd78fd770 deps: fix v8 valgrind warning
Fix the following valgrind warning:

    Conditional jump or move depends on uninitialised value(s)
        at 0x7D64E7: v8::internal::GlobalHandles::IterateAllRootsWithClassIds(v8::internal::ObjectVisitor*) (global-handles.cc:613)
        by 0x94DCDC: v8::internal::NativeObjectsExplorer::FillRetainedObjects() (profile-generator.cc:2849)
        # etc.

This was fixed upstream in r12903 and released in 3.15.2 but that commit
was never back-ported to the 3.14 branch that node.js v0.10 uses.

The code itself works okay; this commit simply shuffles the clauses in
an `if` statement to check that the node is in use before checking its
class id (which is uninitialized if the node is not in use.)
2014-03-07 03:29:00 +04:00
Fedor Indutny 5e06ce4fb9 child_process: fix sending handle twice
When sending a socket to a child process via IPC pipe,
`child_process.js` picks a raw UV handle from `_handle` property, sends
it, and assigns `null` to the property. Sending the same socket twice
was resulting in a runtime error, since we weren't handling the empty
`_handle` case.

In case of `null` `_handle` we should send just a plain text message
as passed it was passed to `.send()` and ignore the handle, letting
users handle such cases themselves instead of throwing the error at
runtime.

fix #5469
2014-03-05 09:36:35 -08:00
Benoit Vallée a9d24fa40d test: test sending a handle twice
Added test-cluster-send-handle-twice.js testing to send a handle
twice to the parent process.
2014-03-05 09:36:32 -08:00
Ben Noordhuis bd8a5755dc src: add default visibility to NODE_MODULE
It's currently not really possible to compile native add-ons with
-fvisibility=hidden because that also hides the struct containing
the module definition.

The NODE_MODULE() and NODE_MODULE_DECL() macros are structured in
a way that makes it impossible to add a visibility attribute manually
so there is no escape hatch there.

That's why this commit adds an explicit visibility attribute to
the module definition.  It doesn't help with node.js releases that
are already out there but at least it improves the situation going
forward.
2014-03-05 15:26:09 +04:00
Brian White 31ce34887f crypto: allow setting add'l authenticated data 2014-03-04 12:42:03 +04:00
Brian White caca4f33aa crypto: fix CipherFinal return value check 2014-03-04 12:42:03 +04:00
Greg Brail 6eb4d1d15c timer: don't reschedule timer bucket in a domain
If two timers run on the same tick, and the first timer uses a domain,
and then catches an exception and disposes of the domain, then the
second timer never runs. (And even if the first timer does not dispose
of the domain, the second timer could run under the wrong domain.)

This happens because timer.js uses "process.nextTick()" to schedule
continued processing of the timers for that tick. However, there was
an exception inside a domain, then "process.nextTick()" runs under
the domain of the first timer function, and will do nothing if
the domain has been disposed.

To avoid this, we temporarily save the value of "process.domain"
before calling nextTick so that it does not run inside any domain.
2014-03-03 17:46:49 -08:00
Timothy J Fontaine 06453a94a7 src: domain should not replace nextTick function
Previously if you cached process.nextTick and then require('domain')
subsequent nextTick() calls would not be caught because enqueued
functions were taking the wrong path. This keeps nextTick to a single
function reference and changes the implementation details after domain
has been required.
2014-03-03 16:27:58 -08:00
Fedor Indutny 78d245f5b2 Merge remote-tracking branch 'origin/v0.10'
Conflicts:
	configure
	lib/_stream_readable.js
	lib/http.js
	src/node_dtrace.cc
2014-03-02 23:54:19 +04:00
Fedor Indutny 34bf6e46be smalloc: remove `env.h` include
Since `smalloc.h` is included in a `node_buffer.h`, including private
headers in it is strictly prohibited.

fix #7206
2014-03-02 12:05:13 +04:00
Fedor Indutny 5596f936d8 node: invoke `beforeExit` again if loop was active
When `setImmediate(cb)` is called in `beforeExit` event handler the
consequent `uv_run(..., UV_RUN_NOWAIT)` may return `0`, even if there
was some active handles at start.

Fixes simple/test-beforeexit-event.js.
2014-03-01 21:30:17 +04:00
Fedor Indutny 3b88dc6f19 stream_wrap: don't write twice on uv_try_write err
fix #7155
2014-02-28 18:02:02 +04:00
Sam Roberts 37d3c56c0b doc: document `beforeExit` and add more tests 2014-02-28 15:36:22 +04:00
Ben Noordhuis a2eeb43ded src: emit 'beforeExit' event on process object
Unlike the 'exit' event, this event allows the user to schedule more
work and thereby postpone the exit.  That also means that the
'beforeExit' event may be emitted many times, see the attached test
case for an example.

Refs #6305.
2014-02-28 14:43:30 +04:00
Saúl Ibarra Corretgé 6e1eac744b src: use new loop API
uv_loop_new and uv_loop_delete are considered deprecated now.
2014-02-28 14:01:52 +04:00
Saúl Ibarra Corretgé 269de79fbf src: spawn_sync should close handles upon exit
When the exit callback is fired for the child process we should close
the handle associated with it.
2014-02-26 18:16:07 -08:00
Timothy J Fontaine afc29ed397 src: update to latest libuv api
libuv gyp builds now require you to define the library disposition
(static or shared).

Also, libuv now supports vectored IO for file system reads and writes,
update to those function signatures
2014-02-26 18:15:07 -08:00
Timothy J Fontaine cd08c8a0e5 uv: Upgrade to v0.11.21 2014-02-26 18:08:30 -08:00
Nathan Rajlich f3189ace6b http: remove the circular dependency
Between `ClientRequest` and `Agent`. The circular require was doing
weird things at load time, like making the `globalAgent` property
be `undefined` from within the context of the "_http_client"
module.

Removing the circular dependency completely fixes this.

This commit effectively removes the undocumented `Agent#request()`
and `Agent#get()` functions.
2014-02-26 13:19:36 -08:00
Nathan Rajlich 0a5d8ca197 test: update "http-*" tests to only use public API
Don't invoke the `agent.requst()` or `agent.get()` functions
directly. Instead, use the public API and pass the agent
instance in as the `agent` option.
2014-02-26 13:19:06 -08:00
Nathan Rajlich d6bbb19f1d http, https: don't depend on `globalAgent`
For the `request()` and `get()` functions. I could never
really understand why these two functions go through agent
first... Especially since the user could be passing `agent: false`
or a different Agent instance completely, in which `globalAgent`
will be completely bypassed.

Moved the relevant logic from `Agent#request()` into the
`ClientRequest` constructor.

Incidentally, this commit fixes #7012 (which was the original
intent of this commit).
2014-02-26 13:18:54 -08:00
Nathan Rajlich d307bebec4 test: add failing http `agent: null` test
See #7012.
2014-02-26 13:05:56 -08:00
Nathan Rajlich 47abdd9c43 test: add `agent: null` http client request test
This is just the test portion from #7012 / #7189,
but targetted for the v0.10 branch.
2014-02-26 11:39:53 -08:00
Nathan Rajlich 0a01a42e87 http: invoke createConnection when no agent
This makes it so that the user may pass in a
`createConnection()` option, and they don't have
to pass `agent: false` at the same time.

Also adding a test for the `createConnection` option,
since none was in place before.

See #7014.
2014-02-26 11:14:32 -08:00
Trevor Norris 846f304fa8 test: fix async-listener-run-error-once
Rely on defined order of operations by closing the server and
destorying the client socket, instead of when setImmediate fires
2014-02-26 10:38:13 -08:00
Alexis Campailla 20176a9841 src: make stdout/sterr pipes blocking
Expose `setBlocking` on Pipe's and if a pipe is being created for stdio
on windows then make the pipes blocking.

This fixes test-stream2-stderr-sync.js on Windows.

Fixes #3584
2014-02-26 10:36:58 -08:00
Alexis Campailla c1bb886990 test: remove invalid part of stream2-stderr-sync
One test case in test-stream2-stderr-sync.js was creating a TTY
object using an undocumented constructor and passing in fd 2.
However, this is running in a child process and fd 2 is actually
a pipe, not a TTY.

The constructor fails on Windows and causes the handle type to be
left uninitialized, which later causes an assert to fail.

On Unix, the constructor fails to retrieve the windows size but unlike
on Windows, it just leaves the size fields undefined and continues
with initializing the stream type, yielding a semi-usable object.

I could make the Windows version match Unix behavior, but it
seems to me that the test is relying on an implementation detail of
an undocumented API, and the Unix behavior is not necessarily more
correct than the Windows one. Thus it makes more sense to remove this
test.
2014-02-26 10:36:23 -08:00
Maxwell Krohn a22a2d8656 tls: stop NodeBIO::Gets from reading off end of buffer
NodeBIO::Gets was reading off the end of a buffer if it
didn't find a "\n" before the EOF.  This behavior
was causing X509 certificates passed to `https.Agent`
via the "ca" option to be silently discarded. It also
was causing improper parsing of certs and keys
passed to https.Agent, but those problems were worked
around in cdde9a3.

Backed out workaround in `lib/crypto.js` from ccde9a3,
which now isn't needed.  But keep the test introduced
in that commit, which tests properly for this
bug.

This bug was first introduced in a58f93f

Gist containing test code, bisection log, and notes:
   https://gist.github.com/maxtaco/9211605
2014-02-26 17:33:10 +04:00
Alexis Campailla b5f9779c2f windows: fix module registration
The linker was optimizing the static variables that were supposed
to trigger module initialization.

I am making them non-static, and dllexport so that they don't get
optimized away.

Fixes #7116
2014-02-25 13:44:38 -08:00
Alexis Campailla 2ca4d9d662 net: fix listening on FDs on Windows
Fix a bug introduced by 3da36fe of a missed early return of a handle
that needed to be passed to listen.

Fixes test-net-listen-fd0.js on Windows
2014-02-25 13:44:38 -08:00