Now that process.createAsyncListener() returns a unique object instance
it is no longer necessary to compare the uid's of the objects.
Signed-off-by: Timothy J Fontaine <tjfontaine@gmail.com>
It was possible that the same AL instance was run twice if it were both
attached to the currentContext then again added to the new asyncQueue
generated for the new stack.
Signed-off-by: Timothy J Fontaine <tjfontaine@gmail.com>
The ability to add/remove an AsyncListener to an object after its
creation was an artifact of trying to get AL working with the domain
module. Now that is no longer necessary and other features are going to
be implemented that would be affected by this functionality. So the code
will be removed for now to simplify the implementation process.
In the future this code will likely be reintroduced, but after some
other more important matters have been addressed.
None of this functionality was documented, as is was meant specifically
for domain specific implementation work arounds.
Signed-off-by: Timothy J Fontaine <tjfontaine@gmail.com>
All C++ code should be using `args.GetIsolate()` or `env->isolate()`.
Using static `node_isolate` var limits possible future functionality
(like multi-isolate support).
addon_register_func and its cousin addon_context_register_func are type
definitions, dllimport and dllexport are name mangling directives, i.e.
they're quite unrelated concepts. MinGW complains about mixing them
when cross-compiling native add-ons.
Signed-off-by: Trevor Norris <trev.norris@gmail.com>
Signed-off-by: Bert Belder <bertbelder@gmail.com>
Before this commit, verification exceptions had err.message set to the
OpenSSL error code (e.g. 'UNABLE_TO_VERIFY_LEAF_SIGNATURE').
This commit moves the error code to err.code and replaces err.message
with a human-readable error. Example:
// before
{
message: 'UNABLE_TO_VERIFY_LEAF_SIGNATURE'
}
// after
{
code: 'UNABLE_TO_VERIFY_LEAF_SIGNATURE',
message: 'unable to verify the first certificate'
}
UNABLE_TO_VERIFY_LEAF_SIGNATURE is a good example of why you want this:
the error code suggests that it's the last certificate that fails to
validate while it's actually the first certificate in the chain.
Going by the number of mailing list posts and StackOverflow questions,
it's a source of confusion to many people.
Before when an AsyncListener object was created and the "create"
callback returned a value, it was necessary to construct a new Object
with the same callbacks but add a place for the new storage value.
Now, instead, a separate storage array is kept on the context which is
used for any return value of the "create" callback. This significantly
reduces the number of Objects that need to be created.
Also added a flags property to the context to quickly check if a
specific callback was available either on the context or on the
AsyncListener instance itself.
Few other minor changes for readability that were difficult to separate
into their own commit.
This has not been optimized yet.
This is a slightly modified revert of bc39bdd.
Getting domains to use AsyncListeners became too much of a challenge
with many edge cases. While this is still a goal, it will have to be
deferred for now until more test coverage can be provided.
Instead of checking the uid on the array index of the queue, instead the
object property "uid" was checked on the queue iteself. Because this
will always evaluate to "undefined" the same listener could be added
multiple times to the same context.
There was a flaw in the old API that has been fixed. Now the
asyncListener callback is now the "create" object property in the
callback object, and is optional.
Eliminate a race condition between uv_async_send and the closing of the
corresponding handle.
Also made errors in Watchdog constructor call abort()
Fixes#6088
This is a comment change, where it originally says disabling TLS
Compression protects against BEAST attack. But in fact, it is the
CRIME attack(Compression Ratio Info-leak Made Easy) that makes use
of TLS Compression and not BEAST.
BEAST(Browser Exploit Against SSL/TLS) is an entirely another variant
making use of the chosen boundary attack against CBC mode in
encryption.
Just making sure, that the exact reason for disabling TLS compression
must be made clear and not be misleading with some other attack.
When `symlink`, `link` or `rename` report EEXIST, ENOTEMPTY or EPERM -
the destination file name should be included in the error message,
instead of source file name.
fix#6510
NOTE: Also removed `.receivedShutdown` method of `Connection` it wasn't
documented anywhere, and was rewritten with `true` after receiving
`close_notify`.
fix#6638
This adds two new member functions getAuthTag and setAuthTag that
are useful for AES-GCM encryption modes. Use getAuthTag after
Cipheriv.final, transmit the tag along with the data and use
Decipheriv.setAuthTag to have the encrypted data verified.
The null signal test existed, but only tested the case where the target
process existed, not when it did not exist.
Also clarified that SIGUSR1 is reserved by Node.js only for receiveing,
its not at all reserved when sending a signal with kill().
kill(pid, 'O_RDWR'), or any other node constant, "worked". I fixed this
by also checking for 'SIG'. The same as done in the isSignal() function.
Now the signal names supported by process.kill() are the same as those
supported by process.on().
Replace call to Number::New() with a call to Integer::NewFromUnsigned().
Profiling a Real World(TM) application with perf(1) suggests that the
conversion of its argument from integer to double is disproportionally
costly: over 60% of CPU cycles accountable to WriteStringImpl() are
attributable to the conversion.
After changing it to Integer::NewFromUnsigned(), WriteStringImpl()
has dropped from the 'most costly functions' top ten altogether.
Add a 'serialNumber' property to the object that is returned by
tls.CryptoStream#getPeerCertificate(). Contains the certificate's
serial number encoded as a hex string. The format is identical to
`openssl x509 -serial -in path/to/certificate`.
Fixes#6583.
context._asyncQueue shouldn't be exposed as asyncQueue, as it allows
modification of queues already attached to an event. Which is not
supposed to happend. Instead context._asyncQueue should be copied.
Removing the depth counter while processing the nextTickQueue made it
possible to run out of memory if in an infinite recursive loop using
nextTick(). There was also an edge case where too many callbacks were
pushed onto the nextTickQueue, while not actually being recursive.
This is being done to prevent possible cryptic FATAL ERROR messages from
popping up, and issues being posted about them.
* uv: upgrade to v0.11.15 (Timothy J Fontaine)
* v8: upgrade to 3.22.24.5 (Timothy J Fontaine)
* buffer: remove warning when no encoding is passed (Trevor Norris)
* build: make v8 use random seed for hash tables (Ben Noordhuis)
* crypto: build with shared openssl without NPN (Ben Noordhuis)
* crypto: update root certificates (Ben Noordhuis)
* debugger: pass on v8 debug switches (Ben Noordhuis)
* domain: use AsyncListener API (Trevor Norris)
* fs: add recursive subdirectory support to fs.watch (Nick Simmons)
* fs: make fs.watch() non-recursive by default (Ben Noordhuis)
* http: cleanup freeSockets when socket destroyed (fengmk2)
* http: force socket encoding to be null (isaacs)
* http: make DELETE requests set `req.method` (Nathan Rajlich)
* node: add AsyncListener support (Trevor Norris)
* src: remove global HandleScope that hid memory leaks (Ben Noordhuis)
* tls: add ECDH ciphers support (Erik Dubbelboer)
* tls: do not default to 'localhost' servername (Fedor Indutny)
* tls: more accurate wrapping of connecting socket (Fedor Indutny)
v8's `messages.js` file's `CallSiteGetMethodName` is running through all
object properties and getter to figure out method name of function that
appears in stack trace. This run-through will also read `fd` property of
`UDPWrap` instance's javascript object, making `UNWRAP()` fail.
As a simple alternative to the test case above, one could just keep
reference to the dgram handle and try accessing `handle.fd` after it has
been fully closed.
fix#6536
Before this commit, passing --debugger and other V8 debug switches to
node.js made node print a usage message and exit.
Rewrite the debug argument parser so it only consumes switches that we
understand and pass everything else as-is to V8.
A side effect of this change is that switches like --debugger_agent and
--debugger_port now work. That kind of obsoletes our debugger switches
because they implement pretty much the same functionality but let's
leave them in for now for the sake of convenience and backwards
compatibility.
Fixes#6526.