summaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* build: fix issue with ETW support on win32Julien Gilli2014-11-033-8/+18
|
* dtrace: fix ustack helperFedor Indutny2014-10-171-1/+1
| | | | | AsciiString is OneByteString now, use ONEBYTESTRINGTAG for ustack helper.
* v8_platform: provide default v8::Platform implFedor Indutny2014-10-163-5/+247
| | | | Provide default Platform implementation for v8's purposes.
* src, test: fixup after v8 updateFedor Indutny2014-10-086-30/+41
| | | | | | | | | | | | | Because of behavior change of some V8 APIs (they mostly became more strict), following modules needed to be fixed: * crypto: duplicate prototype methods are not allowed anymore * contextify: some TryCatch trickery, the binding was using it incorrectly * util: maximum call stack error is now crashing in a different place Reviewed-By: Trevor Norris <trevnorris@gmail.com> PR-URL: https://github.com/joyent/node/pull/8476
* deps: re-implement debugger-agentFedor Indutny2014-10-088-92/+267
| | | | | Reviewed-By: Trevor Norris <trevnorris@gmail.com> PR-URL: https://github.com/joyent/node/pull/8476
* tls_wrap: ignore ZERO_RETURN after close_notifyFedor Indutny2014-10-081-0/+8
| | | | | | | | Do not call SSL_read() and ignore ZERO_RETURN if the connection was shutdown and there could not be any reads. Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> PR-URL: https://github.com/joyent/node/pull/8519
* src: update use of ExternalArrayType constantsTrevor Norris2014-10-083-8/+8
| | | | | | Continuation of 4809c7a to update the use of v8::ExternalArrayType. Signed-off-by: Trevor Norris <trev.norris@gmail.com>
* smalloc: update use of ExternalArrayType constantsTrevor Norris2014-10-081-9/+9
| | | | | | | The constants in enum v8::ExternalArrayType have been changed. The old values are there for legacy reasons, but it's best to update anyway. Signed-off-by: Trevor Norris <trev.norris@gmail.com>
* buffer: mv floating point read/write checks to JSTrevor Norris2014-10-011-41/+19
| | | | | | | | | | Performance improvement by moving checks for floating point operations to JS and doing the operation on a protected internal function that assumes all arguments are correct. Still abort if the operation overflows memory. This can only be caused if the Buffer's length property isn't the same as the actual internal length. Signed-off-by: Trevor Norris <trev.norris@gmail.com>
* node: avoid automatic microtask runsVladimir Kurchatkin2014-10-012-0/+18
| | | | | | | | | | | | | | | | | | | Since we are taking control of the microtask queue it makes sense to disable autorun and only run microtasks when necessary. Just setting isolate->SetAutorunMicrotasks(false) would cause _tickCallback() not to be called. Automatically running the microtask queue will cause it to run: * After callback invocation * Inside _tickCallback() * After _tickCallback() invocation The third one is unnecessary as the microtask queue is guaranteed to be empty at this point. The first only needs to be run manually when _tickCallback() isn't going to be called by MakeCallback(). Reviewed-by: Trevor Norris <trev.norris@gmail.com>
* build, i18n: improve Intl build, add "--with-intl"Steven R. Loomis2014-10-013-0/+166
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The two main goals of this change are: - To make it easier to build the Intl option using ICU (particularly, using a newer ICU than v8/Chromium's version) - To enable a much smaller ICU build with only English support The goal here is to get node.js binaries built this way by default so that the Intl API can be used. Additional data can be added at execution time (see Readme and wiki) More details are at https://github.com/joyent/node/pull/7719 In particular, this change adds the "--with-intl=" configure option to provide more ways of building "Intl": - "full-icu" picks up an ICU from deps/icu - "small-icu" is similar, but builds only English - "system-icu" uses pkg-config to find an installed ICU - "none" does nothing (no Intl) For Windows builds, the "full-icu" or "small-icu" options are added to vcbuild.bat. Note that the existing "--with-icu-path" option is not removed from configure, but may not be used alongside the new option. Wiki changes have already been made on https://github.com/joyent/node/wiki/Installation and a new page created at https://github.com/joyent/node/wiki/Intl (marked as provisional until this change lands.) Summary of changes: * README.md : doc updates * .gitignore : added "deps/icu" as this is the location where ICU is unpacked to. * Makefile : added the tools/icu/* files to cpplint, but excluded a problematic file. * configure : added the "--with-intl" option mentioned above. Calculate at config time the list of ICU source files to use and data packaging options. * node.gyp : add the new files src/node_i18n.cc/.h as well as ICU linkage. * src/node.cc : add call into node::i18n::InitializeICUDirectory(icu_data_dir) as well as new --icu-data-dir option and NODE_ICU_DATA env variable to configure ICU data loading. This loading is only relevant in the "small" configuration. * src/node_i18n.cc : new source file for the above Initialize.. function, to setup ICU as needed. * tools/icu : new directory with some tools needed for this build. * tools/icu/icu-generic.gyp : new .gyp file that builds ICU in some new ways, both on unix/mac and windows. * tools/icu/icu-system.gyp : new .gyp file to build node against a pkg-config detected ICU. * tools/icu/icu_small.json : new config file for the "English-only" small build. * tools/icu/icutrim.py : new tool for trimming down ICU data. Reads the above .json file. * tools/icu/iculslocs.cc : new tool for repairing ICU data manifests after trim operation. * tools/icu/no-op.cc : dummy file to force .gyp into using a C++ linker. * vcbuild.bat : added small-icu and full-icu options, to call into configure. * Fixed toolset dependencies, see https://github.com/joyent/node/pull/7719#issuecomment-54641687 Note that because of a bug in gyp {CC,CXX}_host must also be set. Otherwise gcc/g++ will be used by default for part of the build. Reviewed-by: Trevor Norris <trev.norris@gmail.com> Reviewed-by: Fedor Indutny <fedor@indutny.com>
* buffer: fix and cleanup fill()Trevor Norris2014-09-292-31/+18
| | | | | | | | | | | | | | | | | | | Running fill() with an empty string would cause Node to hang indefinitely. Now it will return without having operated on the buffer. User facing function has been pulled into JS to perform all initial value checks and coercions. The C++ method has been placed on the "internal" object. Coerced non-string values to numbers to match v0.10 support. Simplified logic and changed a couple variable names. Added tests for fill() and moved them all to the beginning of buffer-test.js since many other tests depend on fill() working properly. Fixes: https://github.com/joyent/node/issues/8469 Signed-off-by: Trevor Norris <trev.norris@gmail.com>
* src: fix VC++ warning C4244Rasmus Christian Pedersen2014-09-291-6/+6
| | | | Reviewed-by: Trevor Norris <trev.norris@gmail.com>
* timer_wrap: remove HandleScopes, check return sizeTrevor Norris2014-09-291-14/+9
| | | | | | | | | | | Calls from JS to C++ have an implicit HandleScope. So there is no need to instantiate a new HandleScope in these basic cases. Check if the returned int64_t is an SMI and cast the return value to uint32_t instead of a double. Prevents needing to box the return value, and saves a small amount of execution time. Signed-off-by: Trevor Norris <trev.norris@gmail.com>
* crypto: lower RSS usage for TLSCallbacksFedor Indutny2014-09-264-41/+87
| | | | | | | | | Don't allocate any BIO buffers initially, do this on a first read from the TCP connection. Allocate different amount of data for initial read and for consequent reads: small buffer for hello+certificate, big buffer for better throughput. see #8416
* Now working on 0.11.15Timothy J Fontaine2014-09-241-2/+2
|
* 2014.09.24, Version 0.11.14 (Unstable)Timothy J Fontaine2014-09-241-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * uv: Upgrade to v1.0.0-rc1 * http_parser: Upgrade to v2.3.0 * npm: Upgrade to v2.0.0 * openssl: Upgrade to v1.0.1i * v8: Upgrade to 3.26.33 * Add fast path for simple URL parsing (Gabriel Wicke) * Added support for options parameter in console.dir() (Xavi Magrinyà) * Cluster: fix shared handles on Windows (Alexis Campailla) * buffer: Fix incorrect Buffer.compare behavior (Feross Aboukhadijeh) * buffer: construct new buffer from buffer toJSON() output (cjihrig) * buffer: improve Buffer constructor (Kang-Hao Kenny) * build: linking CoreFoundation framework for OSX (Thorsten Lorenz) * child_process: accept uid/gid everywhere (Fedor Indutny) * child_process: add path to spawn ENOENT Error (Ryan Cole) * child_process: copy spawnSync() cwd option to proper buffer (cjihrig) * child_process: do not access stderr when stdio set to 'ignore' (cjihrig) * child_process: don't throw on EAGAIN (Charles) * child_process: don't throw on EMFILE/ENFILE (Ben Noordhuis) * child_process: use full path for cmd.exe on Win32 (Ed Morley) * cluster: allow multiple calls to setupMaster() (Ryan Graham) * cluster: centralize removal from workers list. (Julien Gilli) * cluster: enable error/message events using .worker (cjihrig) * cluster: include settings object in 'setup' event (Ryan Graham) * cluster: restore v0.10.x setupMaster() behaviour (Ryan Graham) * cluster: support options in Worker constructor (cjihrig) * cluster: test events emit on cluster.worker (Sam Roberts) * console: console.dir() accepts options object (Xavi Magrinyà) * crypto: add `honorCipherOrder` argument (Fedor Indutny) * crypto: allow padding in RSA methods (Fedor Indutny) * crypto: clarify RandomBytes() error msg (Mickael van der Beek) * crypto: never store pointer to conn in SSL_CTX (Fedor Indutny) * crypto: unsigned value can't be negative (Brian White) * dgram: remove new keyword from errnoException (Jackson Tian) * dns: always set variable family in lookup() (cjihrig) * dns: include host name in error message if available (Maciej Małecki) * dns: introduce lookupService function (Saúl Ibarra Corretgé) * dns: send lookup c-ares errors to callback (Chris Dickinson) * dns: throw if hostname is not string or falsey (cjihrig) * events: Output the event that is leaking (Arnout Kazemier) * fs: close file if fstat() fails in readFile() (cjihrig) * fs: fs.readFile should not throw uncaughtException (Jackson Tian) * http: add 308 status_code, see RFC7238 (Yazhong Liu) * http: don't default OPTIONS to chunked encoding (Nick Muerdter) * http: fix bailout for writeHead (Alex Kocharin) * http: remove unused code block (Fedor Indutny) * http: write() after end() emits an error. (Julien Gilli) * lib, src: add vm.runInDebugContext() (Ben Noordhuis) * lib: noisy deprecation of child_process customFds (Ryan Graham) * module: don't require fs several times (Robert Kowalski) * net,dgram: workers can listen on exclusive ports (cjihrig) * net,stream: add isPaused, don't read() when paused (Chris Dickinson) * net: Ensure consistent binding to IPV6 if address is absent (Raymond Feng) * net: add remoteFamily for socket (Jackson Tian) * net: don't emit listening if handle is closed (Eli Skeggs) * net: don't prefer IPv4 addresses during resolution (cjihrig) * net: don't throw on net.Server.close() (cjihrig) * net: reset `errorEmitted` on reconnect (Ed Umansky) * node: set names for prototype methods (Trevor Norris) * node: support v8 microtask queue (Vladimir Kurchatkin) * path: fix slice OOB in trim (Lucio M. Tato) * path: isAbsolute() should always return boolean (Herman Lee) * process: throw TypeError if kill pid not a number (Sam Roberts) * querystring: custom encode and decode (fengmk2) * querystring: do not add sep for empty array (cjihrig) * querystring: remove prepended ? from query field (Ezequiel Rabinovich) * readline: fix close event of readline.Interface() (Yazhong Liu) * readline: fixes scoping bug (Dan Kaplun) * readline: implements keypress buffering (Dan Kaplun) * repl: fix multi-line input (Fedor Indutny) * repl: fix overwrite for this._prompt (Yazhong Liu) * repl: proper `setPrompt()` and `multiline` support (Fedor Indutny) * stream: don't try to finish if buffer is not empty (Vladimir Kurchatkin) * stream: only end reading on null, not undefined (Jonathan Reem) * streams: set default hwm properly for Duplex (Andrew Oppenlander) * string_bytes: ucs2 support big endian (Andrew Low) * tls, crypto: add DHE support (Shigeki Ohtsu) * tls: `checkServerIdentity` option (Trevor Livingston) * tls: add DHE-RSA-AES128-SHA256 to the def ciphers (Shigeki Ohtsu) * tls: better error reporting at cert validation (Fedor Indutny) * tls: support multiple keys/certs (Fedor Indutny) * tls: throw an error, not string (Jackson Tian) * udp: make it possible to receive empty udp packets (Andrius Bentkus) * url: treat the same as / (isaacs)
* tls_wrap: ensure that TLSCallbacks are gc-ableFedor Indutny2014-09-242-1/+3
| | | | | | | | Call `MakeWeak()` to destruct TLSCallbacks when the js-object dies. fix #8416 Reviewed-By: Fedor Indutny <fedor@indutny.com>
* deps: update uv to v1.0.0-rc1Fedor Indutny2014-09-231-27/+34
|
* crypto: export externals to internal structsFedor Indutny2014-09-233-0/+51
| | | | Export External getters for a internal structs: SSL, SSL_CTX.
* node: support v8 microtask queueVladimir Kurchatkin2014-09-182-1/+39
| | | | | | | | | | | When V8 started supporting Promises natively it also introduced a microtack queue. This feature operates similar to process.nextTick(), and created an issue where neither knew when the other had run. This patch has nextTick() call the microtask queue runner at the end of processing callbacks in the nextTickQueue. Fixes: https://github.com/joyent/node/issues/7714 Reviewed-by: Trevor Norris <trev.norris@gmail.com>
* crypto: never store pointer to conn in SSL_CTXFedor Indutny2014-09-183-24/+18
| | | | | | | | | SSL_CTX is shared between multiple connections and is not a right place to store per-connection data. fix #8348 Reviewed-By: Trevor Norris
* crypto: clarify RandomBytes() error msgMickael van der Beek2014-09-171-1/+1
| | | | Reviewed-by: Trevor Norris <trev.norris@gmail.com>
* win: manifest node.exe for Windows 8.1Alexis Campailla2014-09-171-0/+15
| | | | | | | | | | Adding a compatibility section to node.exe embedded manifest so that Node is declared explicitly compatible with Windows 8.1. Required so that os.release() can return the correct version on Windows 8.1. See http://msdn.microsoft.com/en-us/library/windows/desktop/ms724451(v=vs.85).aspx Reviewed-by: Trevor Norris <trev.norris@gmail.com>
* lib, src: add vm.runInDebugContext()Ben Noordhuis2014-09-161-0/+16
| | | | | | | | | | | Compiles and executes source code in V8's debugger context. Provides a programmatic way to get access to the debug object by executing: var Debug = vm.runInDebugContext('Debug'); Fixes #7886. Reviewed-by: Trevor Norris <trev.norris@gmail.com>
* tls: fix encoding in certificate-related functionsAdam Lippai2014-09-151-8/+15
| | | | | | | | | Strings are treated as UTF8 instead of one-byte strings when names are processed and when OpenSSL's ..._print functions are used. This commit fixes simple/test-tls-peer-certificate-encoding test. fix #8366
* src: remove Environment::GetCurrentChecked()Ben Noordhuis2014-09-053-22/+6
| | | | | | | There is only one call site that uses it and that can do the checks itself. Removes ~15 lines of code. Reviewed-by: Trevor Norris <trev.norris@gmail.com>
* src: update and expand comments in base-object.hBen Noordhuis2014-09-051-2/+7
| | | | | | | | | It's safe to call BaseObject::object() from your destructor _unless_ the handle is weak; then it's the weak callback that is calling your destructor and the object will have been released by the time the destructor runs. Reviewed-by: Trevor Norris <trev.norris@gmail.com>
* lib, src: don't make http parser handles weakBen Noordhuis2014-09-051-1/+11
| | | | | | | | Weak handles put strain on the garbage collector and the parser handle doesn't need to be weak in the first place. This change should improve GC times on busy servers a little. Reviewed-by: Trevor Norris <trev.norris@gmail.com>
* src: add ClearWrap() to util.hBen Noordhuis2014-09-052-0/+6
| | | | | | | Counterpart to Wrap(), clears the previously assigned internal field. Will be used in an upcoming commit. Reviewed-by: Trevor Norris <trev.norris@gmail.com>
* src: fix handle leak in Parser::Execute()Ben Noordhuis2014-09-051-1/+1
| | | | | | | | Fix a resource leak where an intermediate Local<Context> handle in Environment::GetCurrent() got leaked into whatever HandleScope was further up the stack. Reviewed-by: Trevor Norris <trev.norris@gmail.com>
* tls_wrap: fix use after freeFedor Indutny2014-09-033-5/+8
| | | | | Do not free TLSCallbacks from StreamWrap. TLSCallbacks is bound to a V8 object and should be collected by V8's GC.
* crypto: use less memory for storing keysFedor Indutny2014-09-031-12/+3
| | | | | Use `BIO_new_mem_buf` where possible to reduce memory usage and initialization costs.
* stream_wrap: Add support to write binary stringsTrevor Norris2014-09-035-0/+15
| | | | | | | | node::StringBytes::Write() has appropriate support to write strings with 'binary' encoding. So expose that API through StreamWrap and allow inheriting classes to use it. Signed-off-by: Trevor Norris <trev.norris@gmail.com>
* node,async-wrap: verify domain enter/exit are setTrevor Norris2014-09-022-24/+20
| | | | | | | | | | | | | The REPL global object lazy loads modules by placing getters for each. This causes MakeDomainCallback() to be run if a native module is loaded from the REPL, but if the domain module hasn't been loaded then there are no enter/exit callbacks to be called. Causing an assert() to fail. Fix the issue by conditionally running the callback instead of asserting it is available. Also add "addon" test to verify the fix. Fixes: #8231 Signed-off-by: Trevor Norris <trev.norris@gmail.com>
* cluster: centralize removal from workers list.Julien Gilli2014-09-021-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Currently, cluster workers can be removed from the workers list in three different places: - In the exit event handler for the worker process. - In the disconnect event handler of the worker process. - In the disconnect event handler of the cluster master. However, handles for a given worker are cleaned up only in one of these places: in the cluster master's disconnect event handler. Because these events happen asynchronously, it is possible that the workers list is empty before we even clean up one handle. This makes the assert that makes sure that no handle is left when the workers list is empty fail. This commit removes the worker from the cluster.workers list only when the worker is dead _and_ disconnected, at which point we're sure that its associated handles are cleaned up. Fixes #8191 and #8192. Reviewed-By: Fedor Indutny <fedor@indutny.com>
* crypto: unsigned value can't be negativeBrian White2014-09-021-2/+2
| | | | Reviewed-By: Fedor Indutny <fedor@indutny.com>
* crypto: avoid memory leakBrian White2014-09-021-1/+2
| | | | Reviewed-By: Fedor Indutny <fedor@indutny.com>
* src: reading/owner/onread/onconnection for tcpJackson Tian2014-09-021-0/+13
| | | | | | Initialize fields to avoid Hidden Class creation in runtime. Reviewed-By: Fedor Indutny <fedor@indutny.com>
* crypto: wrap ECDH constants in HAVE_OPENSSLIsaac Burns2014-09-011-0/+2
| | | | Reviewed-By: Fedor Indutny <fedor@indutny.com>
* tls, crypto: add DHE supportShigeki Ohtsu2014-08-292-0/+33
| | | | | | | | In case of an invalid DH parameter file, it is sliently discarded. To use auto DH parameter in a server and DHE key length check in a client, we need to wait for the next release of OpenSSL-1.0.2. Reviewed-By: Fedor Indutny <fedor@indutny.com>
* crypto: introduce ECDHFedor Indutny2014-08-293-0/+265
|
* src: Add function name for .byteLength/.compareJackson Tian2014-08-271-6/+9
| | | | Reviewed-By: Fedor Indutny <fedor@indutny.com>
* crypto: allow padding in RSA methodsFedor Indutny2014-08-273-2/+32
| | | | Reviewed-By: Trevor Norris <trevnorris@gmail.com>
* crypto: fix memory leak in Connection::NewFedor Indutny2014-08-231-1/+0
| | | | | | | Do not create `SSL` instance twice, `SSL_new` is called from `SSLBase` constructor anyway. Reviewed-By: Fedor Indutny <fedor@indutny.com>
* node: add missing Isolate::Scope at startupBen Noordhuis2014-08-191-0/+1
| | | | Reviewed-by: Trevor Norris <trev.norris@gmail.com>
* src: add missing Isolate argumentsYazhong Liu2014-08-192-3/+5
| | | | Reviewed-by: Trevor Norris <trev.norris@gmail.com>
* src: change kIsolateSlot to 3Cheng Zhao2014-08-131-3/+11
| | | | | | | | The slot 0 and 1 had already been taken by "gin" and "blink" in Chrome, and the size of isolate's slots is 4 by default, so using 3 should hopefully make node work independently when embedded into other application. Reviewed-By: Fedor Indutny <fedor@indutny.com>
* src: require EventEmitter via NativeModuleTrevor Norris2014-08-121-1/+1
| | | | | | | Fixes a recent change causing test-process-kill-pid.js to fail. Fixes: 931cbc1 "lib: don't use emitter.listeners(type).length" Signed-off-by: Trevor Norris <trev.norris@gmail.com>
* lib: don't use emitter.listeners(type).lengthJackson Tian2014-08-121-1/+1
| | | | Reviewed-by: Trevor Norris <trev.norris@gmail.com>