-r/--require can be used to preload modules on node startup. The option
takes a single module name. The option can be repeated as necessary to
preload multiple modules.
This patch allows 'vendors' (such a cloud host) to inject functionality
that gets executed at application startup without requiring an explicit
require from the user's application. This can be useful to load vendor
specific application monitoring APIs transparently.
PR-URL: https://github.com/iojs/io.js/pull/881
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
Reviewed-By: Chris Dickinson <christopher.s.dickinson@gmail.com>
The host of melissadata.net has a cross root certification between
Starfield Class 2 and ValiCert Class 2. OpenSSL-1.0.1 only looks up
a cert chain to the deprecated ValiCert Class 2 CA and causes
untrusted error. We add it for a short-term remedy and it is to be
removed after upgrading OpenSSSL-1.0.2 and applying private patches
to support alternative cert chains.
See #402 and #589.
Fixes: https://github.com/iojs/io.js/issues/923
PR-URL: https://github.com/iojs/io.js/pull/1135
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Paths used on the Windows command line need to be enclosed in double
quotes, or they'll be parsed incorrectly when there are spaces in the
path.
PR-URL: https://github.com/iojs/io.js/pull/1122
Reviewed-by: Bert Belder <bertbelder@gmail.com>
Using st_size to read non-regular files can lead to not reading all the
data.
PR-URL: https://github.com/iojs/io.js/pull/1074
Reviewed-By: Bert Belder <bertbelder@gmail.com>
Ensure HandleScope is created before creating any new handles (which
`Context::Scope` and `Environment::GetCurrent` does).
PR-URL: https://github.com/iojs/io.js/pull/1133
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Rod Vagg <rod@vagg.org>
Reviewed-By: Brian White <mscdex@mscdex.net>
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/iojs/io.js/pull/1126
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
Reviewed-by: Bert Belder <bertbelder@gmail.com>
And by cross-platform I mean Linux and OS X. The awk script is not
compatible with BSD awk, that's why this commit changes it to perl.
Update the .mailmap to remove some duplicates and regenerate the
AUTHORS file.
Fixes: https://github.com/iojs/io.js/issues/1120
PR-URL: https://github.com/iojs/io.js/pull/1121
Reviewed-By: Rod Vagg <rod@vagg.org>
Set proxied methods wrappers in `TLSWrap` prototype instead of doing it
on every socket allocation. Should speed up things a bit and will
certainly make heapsnapshot less verbose.
PR-URL: https://github.com/iojs/io.js/pull/1108
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
The .parent property of the allocated buffer should remain undefined in
the case that it's not a slice. Also included test to verify this.
PR-URL: https://github.com/iojs/io.js/pull/1109
Reviewed-By: Chris Dickinson <christopher.s.dickinson@gmail.com>
Reviewed-By: Fedor Indutny <fedor@indutny.com>
Read all pending data out of the socket on `error` event and ensure that
no `data`/`end` handlers will be invoked on `socket.destroy()`.
Otherwise following assertion happens:
AssertionError: null == true
at TLSSocket.socketOnData (_http_client.js:308:3)
at TLSSocket.emit (events.js:107:17)
at TLSSocket.Readable.read (_stream_readable.js:373:10)
at TLSSocket.socketCloseListener (_http_client.js:229:10)
at TLSSocket.emit (events.js:129:20)
at TCP.close (net.js:476:12)
Fix: https://github.com/joyent/node/issues/9348
PR-URL: https://github.com/iojs/io.js/pull/1103
Reviewed-By: Rod Vagg <rod@vagg.org>
Reviewed-By: Nicu Micleușanu <micnic90@gmail.com>
Adjust V8's external memory size when allocating buffers for TLS data to
ensure that V8 has enough information to trigger the GC at right time.
PR-URL: https://github.com/iojs/io.js/pull/1085
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Encapsulate allocation/disposal of `WriteWrap` instances into the
`WriteWrap` class itself.
PR-URL: https://github.com/iojs/io.js/pull/1090
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
See commit `4877ec0`, where it now warns on a clang++ version older than
3.4.
PR-URL: https://github.com/iojs/io.js/pull/1094
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
The SYNC_CALL macro returns on error, bypassing the delete[] call.
Mea culpa, it looks like I introduced this memory leak back in 2013,
in commit d2b80b8a ("src: clean up FSReqWrap").
PR-URL: https://github.com/iojs/io.js/pull/1092
Reviewed-By: Fedor Indutny <fedor@indutny.com>
Fix a bad delete of a pointer that was allocated with placement new.
Casting the pointer was not the right solution because there was at
least one non-placement new constructor call.
This commit rewrites FSReqWrap to be more explicit about ownership of
the auxiliary data and removes a number of egregious const_casts.
The ASYNC_DEST_CALL macro also gets significantly slimmed down.
PR-URL: https://github.com/iojs/io.js/pull/1092
Reviewed-By: Fedor Indutny <fedor@indutny.com>
Add a Context::Scope that was overlooked in commit 583a868
("stream_wrap: add HandleScope's in uv callbacks").
PR-URL: https://github.com/iojs/io.js/pull/1084
Reviewed-By: Fedor Indutny <fedor@indutny.com>
Notable changes:
* buffer: New `Buffer#indexOf()` method, modelled off `Array#indexOf()`.
Accepts a String, Buffer or a Number. Strings are interpreted as UTF8.
(Trevor Norris) https://github.com/iojs/io.js/pull/561
* fs: `options` object properties in `'fs'` methods no longer perform a
`hasOwnProperty()` check, thereby allowing options objects to have
prototype properties that apply. (Jonathan Ong)
https://github.com/iojs/io.js/pull/635
* tls: A likely TLS memory leak was reported by PayPal. Some of the recent
changes in stream_wrap appear to be to blame. The initial fix is in
https://github.com/iojs/io.js/pull/1078, you can track the progress
toward closing the leak at
https://github.com/iojs/io.js/issues/1075 (Fedor Indutny).
* npm: Upgrade npm to 2.7.0. See npm CHANGELOG.md:
https://github.com/npm/npm/blob/master/CHANGELOG.md#v270-2015-02-26
for details including why this is a semver-minor when it could have
been semver-major.
* TC: Colin Ihrig (@cjihrig) resigned from the TC due to his desire to do
more code and fewer meetings.
Every npm version bump requires a few patches to be floated on
node-gyp for io.js compatibility. These patches are found in
03d199276e,
5de334c230, and
da730c76e9. This commit squashes
them into a single commit.
PR-URL: https://github.com/iojs/io.js/pull/990
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Hold non-persistent reference in JS, rather than in C++ to avoid cycles.
PR-URL: https://github.com/iojs/io.js/pull/1078
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Don't forget to call `MakeWeak` to ensure that instance objects are
garbage collectable.
PR-URL: https://github.com/iojs/io.js/pull/1078
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
After upgrading to a newer v8 mdb is pretty much broken - even if using
the latest updates from nodejs. If nodejs decides to update their v8 we
can give it another go, but for now it's better to remove it than have
it in our tree unsupported.
PR-URL: https://github.com/iojs/io.js/pull/1023
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Rod Vagg <rod@vagg.org>
This changes the behavior for http to send send a Content-Length header
instead of using chunked encoding when we know the size of the body when
sending the headers.
Fixes: https://github.com/iojs/io.js/issues/1044
PR-URL: https://github.com/iojs/io.js/pull/1062
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Rod Vagg <rod@vagg.org>
Reviewed-By: Brian White <mscdex@mscdex.net>
StringBytes::Write() did a plain memcpy() when is_extern is true but
that's wrong when the source is a two-byte string and the destination
a one-byte or UTF-8 string.
The impact is limited to strings > 1,031,913 bytes because those are
normally the only strings that are externalized, although the use of
the 'externalize strings' extension (--expose_externalize_string) can
also trigger it.
This commit also cleans up the bytes versus characters confusion in
StringBytes::Write() because that was closely intertwined with the
UCS-2 encoding regression. One wasn't fixable without the other.
Fixes: https://github.com/iojs/io.js/issues/1024
Fixes: https://github.com/joyent/node/issues/8683
PR-URL: https://github.com/iojs/io.js/pull/1042
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
Make StringBytes::GetExternalParts() return the byte length for two-byte
strings, not the character length. Its callers operate on bytes, not
characters.
This also fixes StringBytes::Size() reporting only half of the actual
number of bytes for external two-byte strings.
PR-URL: https://github.com/iojs/io.js/pull/1042
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
Make the algorithm that creates the big input strings a little easier
to comprehend. No functional changes, the string lengths are unchanged.
PR-URL: https://github.com/iojs/io.js/pull/1042
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
Rename `val_` to `string`. The underscore suffix is normally reserved
for data members, not locals, and it's not a great name in the first
place.
PR-URL: https://github.com/iojs/io.js/pull/1042
Reviewed-By: Trevor Norris <trev.norris@gmail.com>