roundUpToNextPowerOf2() does more than just rounding up to the next
power of two. Rename it to computeNewHighWaterMark().
PR-URL: https://github.com/nodejs/node/pull/2479
Reviewed-By: Chris Dickinson <christopher.s.dickinson@gmail.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Don't iterate over all 32 bits, use some hacker's delight bit twiddling
to compute the next power of two.
The logic can be reduced to `n = 1 << 32 - Math.clz32(n)` but then it
can't easily be backported to v2.x; Math.clz32() was added in V8 4.3.
PR-URL: https://github.com/nodejs/node/pull/2479
Reviewed-By: Chris Dickinson <christopher.s.dickinson@gmail.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
The high watermark is capped at 8 MB, not 128 MB like the comment
in lib/_stream_readable.js said.
PR-URL: https://github.com/nodejs/node/pull/2479
Reviewed-By: Chris Dickinson <christopher.s.dickinson@gmail.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
This is a port of joyent/node@16bcd68dc5 .
Original commit message:
The original change that added support for running custom actions
during the install process
(joyent/node@e7c84f82c7) assumed that
Visual Studio 2013 is used to generate the installer file.
However, that is not always the case, and older versions of Visual
Studio should allow users to generate Windows installer files. This
change makes the custom actions visual studio project use the visual
studio version that is found by vcbuild.bat.
Reviewed-By: João Reis <reis@janeasystems.com>
PR-URL: https://github.com/joyent/node/pull/25569
PR-URL: https://github.com/nodejs/node/pull/2365
Reviewed-By: Alexis Campailla <alexis@janeasystems.com>
The deprecation messages in the documentations should be in the format
Stability: 0 - Deprecated: Use [alternate] instead.
so that they will be consistent.
PR-URL: https://github.com/nodejs/node/pull/2450
Reviewed-By: Roman Reiss <me@silverwind.io>
Reviewed-By: James M Snell <jasnell@gmail.com>
This patch documentes the deprecation of util.is* functions.
As per the deprecation policy dicussion, nodejs/dev-policy/issues/49,
we need to start with documenting the deprecation. So, this is
the first step towards officially removing them.
PR-URL: https://github.com/nodejs/node/pull/2447
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rod Vagg <rod@vagg.org>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
This commit replaces instances of io.js with Node.js, based on the
recent convergence. There are some remaining instances of io.js,
related to build and the installer.
Fixes: https://github.com/nodejs/node/issues/2361
PR-URL: https://github.com/nodejs/node/pull/2367
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: João Reis <reis@janeasystems.com>
This adds a new `--tls-cipher-list` command line switch
that can be used to override the built-in default cipher
list. The intent of this is to make it possible to enforce
an alternative default cipher list at the process level.
Overriding the default cipher list is still permitted at
the application level by changing the value of
`require('tls').DEFAULT_CIPHERS`.
As part of the change, the built in default list is moved
out of tls.js and into node_constants.h and node_constants.cc.
Two new constants are added to require('constants'):
* defaultCipherList (the active default cipher list)
* defaultCoreCipherList (the built-in default cipher list)
A test case and doc changes are included.
A new NODE_DEFINE_STRING_CONSTANT macro is also created in
node_internals.h
When node_constants is initialized, it will pick up either
the passed in command line switch or fallback to the default
built-in suite.
Within joyent/node, this change had originaly been wrapped
up with a number of other related commits involving the
removal of the RC4 cipher. This breaks out this isolated
change.
/cc @mhdawson, @misterdjules, @trevnorris, @indutny, @rvagg
Reviewed By: Ben Noordhuis <ben@strongloop.com>
PR-URL: https://github.com/nodejs/node/pull/2412
Adds mention of response.finished to http.markdown
Originally submitted by @hackerjs. The original
commit needed a bit of cleanup on grammar.
Reviewed By: James M Snell <jasnell@gmail.com>
Reviewed By: Michaël Zasso <mic.besace@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/2414
Update AUTHORS list using tools/update-authors.sh
Fix @muddletoes' .mailmap entry
PR-URL: https://github.com/nodejs/node/pull/2505
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Instead of throwing an error with `Bad arguments` the fs methods
return a concrete error message. If an argument is missing, the
methods throw an error with the information, what is missing.
In case of a type mismatch, they throw an error with some hints,
what datatype is expected.
PR-URL: https://github.com/nodejs/node/pull/2495
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
When an anchor tag is used within a pre tag, the link is not
distinguishable. This patch makes sure that the links are highlighted
by underlining them.
PR-URL: https://github.com/nodejs/node/pull/2491
Reviewed-By: Roman Reiss <me@silverwind.io>
Refactored version of https://github.com/joyent/node/pull/25819
Removes integer keys (and keys starting with numbers) from
candidate list on repl tab complete. Refactored the originally
submitted change to simplify and ensure that the integer keys
do not show up on objects either.
Reviewed By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/2409
Original commit message:
buffer: align chunks on 8-byte boundary
When slicing global pool - ensure that the underlying buffer's data
ptr is 8-byte alignment to do not ruin expectations of 3rd party C++
addons.
NOTE: 0.10 node.js always returned aligned pointers and io.js should
do this too for compatibility.
PR-URL: https://github.com/nodejs/node/pull/2487
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
Previously, V8:SetFlagsFromCommandLine was being called even if v8_argc
was 0. This change prevents that from being called unless v8 arguments
are actually passed.
Improves startup time by about 5%.
PR-URL: https://github.com/nodejs/node/pull/2483
Reviewed-By: Rod Vagg <rod@vagg.org>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Use correct deallocator for returned buffera.
Don't free internal structure via ASN1_STRING_data.
Deallocate NETSCAPE_SPKI.
PR-URL: https://github.com/nodejs/node/pull/2359
Reviewed-By: Fedor Indutny <fedor@indutny.com>
This resolves joyent/node#9272. `tlsSocket.getPeerCertificate` will
return an empty object when the peer does not provide a certificate,
but, prior to this, when the certificate is empty, `checkServerIdentity`
would throw because the `subject` wasn't present on the cert.
`checkServerIdentity` must return an error, not throw one, so this
returns an error when the cert is empty instead of throwing
a `TypeError`.
PR-URL: https://github.com/nodejs/node/pull/2343
Reviewed-By: Fedor Indutny <fedor@indutny.com>
Reviewed-By: Shigeki Ohtsu <ohtsu@iij.ad.jp>
There is no way a line can be called after throwing an exception.
PR-URL: https://github.com/nodejs/node/pull/2289
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Reviewed-By: Roman Reiss <me@silverwind.io>
Reviewed-By: Brendan Ashworth <brendan.ashworth@me.com>
If you have no history file written to disk, but the environment
variable set, `fs.readFileSync` will throw an ENOENT error,
but there's nothing to convert. The converter should ignore
ENOENT on that `fs.readFileSync` call.
Fixes: https://github.com/nodejs/node/issues/2449
PR-URL: https://github.com/nodejs/node/pull/2451
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Expose and use in TLSWrap an `v8::External` wrap of the
`StreamBase*` pointer instead of guessing the ancestor C++ class in
`node_wrap.h`.
Make use of `StreamBase::Callback` structure for storing/passing both
callback and context in a single object.
Introduce `GetObject()` for future user-land usage, when a child class
is not going to be inherited from AsyncWrap.
PR-URL: https://github.com/nodejs/node/pull/2351
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
Previously 1000-1200ms, they're now (platform dependent) 50-100ms.
Improves test run time on my machine from 0m1.335s to 0m0.236s.
PR-URL: https://github.com/nodejs/node/pull/2429
Reviewed-By: Rich Trott <rtrott@gmail.com>
Previously the test had a massive timeout (3s!), reduce this to a
platform specific timeout of 50ms.
This test runs two servers at the same time in an attempt to compare
behaviour. I've added a check to make sure one event fires before the
other event, as is expected, but that is a possible race condition.
Improves test run time on my machine from 0m3.141s to 0m0.356s.
PR-URL: https://github.com/nodejs/node/pull/2429
Reviewed-By: Rich Trott <rtrott@gmail.com>
This includes the following changes:
- a more strict data check rather than a regex
- reduced number of annoying log calls
The most important of the changes is the annoying log calls, which
speeds up the test execution from about 0m1.130s to 0m0.481s on my
machine.
PR-URL: https://github.com/nodejs/node/pull/2429
Reviewed-By: Rich Trott <rtrott@gmail.com>
As per the discussion in #734, this patch deprecates the usage of
`EventEmitter.listenerCount` static function in the docs, and introduces
the `listenerCount` function in the prototype of `EventEmitter` itself.
PR-URL: https://github.com/nodejs/node/pull/2349
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
Reviewed-By: Brian White <mscdex@mscdex.net>
v8::Isolate::GetCurrent() is not exactly deprecated at this point but
its use is strongly discouraged. Update the addon tests so they no
longer use it.
PR-URL: https://github.com/nodejs/node/pull/2427
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
Add files in test/addon to the `make cpplint` rule and fix up existing
style issues. Tests scraped from doc/api/addon.md are filtered out
because those are predominantly for illustrative purposes.
PR-URL: https://github.com/nodejs/node/pull/2427
Reviewed-By: Trevor Norris <trev.norris@gmail.com>