Commit Graph

10236 Commits (b26dd4e5ab9192bad72b9dc61fa4ad2d8f215da2)

Author SHA1 Message Date
Patrick Mooney b26dd4e5ab net: Make server.connections un-enumerable
The property server.connections should no longer be enumerable because
it has been deprecated. This will prevent deprecation warnings when
server objects are accessed by functions such as JSON.stringify.

Fixes: https://github.com/joyent/node/issues/8373
Reviewed-by: Trevor Norris <trev.norris@gmail.com>
2014-09-24 16:06:46 -07:00
Robert Kowalski efa47e593d benchmark: add test for module loader
Adds a test for benchmarking the module loader, needed for benchmarking
changes / refacortings in the module loader.

Reviewed-by: Trevor Norris <trev.norris@gmail.com>
Reviewed-by: Timothy J Fontaine <tjfontaine@gmail.com>
2014-09-24 15:48:55 -07:00
Timothy J Fontaine f773fb41cc test: disable dgram-bind-shared-ports on win32
Windows currently doesn't support clustered dgram sockets, when it does
re-enable this test
2014-09-24 14:17:42 -07:00
Julien Gilli 2f7234d89c tests: add test for buffer.slice.
4c9b30d introduced a regression in buffer.slice that 7c3c51b fixed, but
no test had been added to make sure that a similar regression is caught
by the tests suite in the future.
2014-09-24 09:48:41 -07:00
Fedor Indutny 4dbb84fc52 tls_wrap: ensure that TLSCallbacks are gc-able
Call `MakeWeak()` to destruct TLSCallbacks when the js-object dies.

fix #8416

Reviewed-By: Fedor Indutny <fedor@indutny.com>
2014-09-24 14:02:40 +04:00
Trevor Norris 7c3c51b8ff buffer: fix map and set parent to undefined
In 4c9b30d removal of the prototype attributes meant NativeBuffer() no
longer had the same object map as Buffer(). By now setting the same
properties in the same order both constructors will produce the same
map.

The same commit changed "parent" from undefined to null. This caused a
failure in Buffer#slice() where it was checked if parent === undefined.
Causing the incorrect parent to be set.

Signed-off-by: Trevor Norris <trev.norris@gmail.com>
2014-09-23 17:10:36 -07:00
Fedor Indutny 7fd35e6ea4 uv: apply floating patch 2f54947b 2014-09-24 00:19:39 +04:00
Fedor Indutny c5f5d4cd11 deps: update uv to v1.0.0-rc1 2014-09-23 08:18:41 -07:00
Fedor Indutny 6e08bb94e8 crypto: export externals to internal structs
Export External getters for a internal structs: SSL, SSL_CTX.
2014-09-23 13:54:03 +04:00
Julien Gilli 64d6de9f34 http: write() after end() emits an error.
When calling write() after end() has been called on an OutgoingMessage,
an error is emitted and the write's callback is called with an instance
of Error.

Fix #7477.

Reviewed-By: Fedor Indutny <fedor@indutny.com>
2014-09-23 11:54:26 +04:00
Kang-Hao Kenny 4c9b30db67 buffer: improve Buffer constructor
Increase the performance of new Buffer construction by initializing all
properties before SetIndexedPropertiesToExternalArrayData call.

Reviewed-by: Trevor Norris <trev.norris@gmail.com>
2014-09-19 17:11:10 -07:00
Andrew Teich d66adf0c85 doc: corrected typo in vm docs
Reviewed-by: Trevor Norris <trev.norris@gmail.com>
2014-09-19 16:55:25 -07:00
Vladimir Kurchatkin 30bd7b672c node: support v8 microtask queue
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>
2014-09-18 14:13:06 -07:00
Julien Gilli 9c992bdb75 test: add test for cluster.worker.destroy()
Add a simple test to cover workers' implementation of
Worker.prototype.destroy(). Before adding this test, this code wouldn't
be covered by the tests suite, and any regression introduced in workers'
implementation of Worker.prototype.destroy wouldn't be caught.

Fixes: https://github.com/joyent/node/issues/8223
Reviewed-by: Trevor Norris <trev.norris@gmail.com>
2014-09-18 14:06:21 -07:00
Fedor Indutny cb4ed3c78f crypto: never store pointer to conn in SSL_CTX
SSL_CTX is shared between multiple connections and is not a right place
to store per-connection data.

fix #8348

Reviewed-By: Trevor Norris
2014-09-18 02:31:47 +04:00
Mickael van der Beek c615545416 crypto: clarify RandomBytes() error msg
Reviewed-by: Trevor Norris <trev.norris@gmail.com>
2014-09-17 14:40:01 -07:00
Alexis Campailla 03e93526e6 win: manifest node.exe for Windows 8.1
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>
2014-09-17 14:26:35 -07:00
Guilherme de Souza 378d9723f2 doc: console example improvement
Reviewed-by: Trevor Norris <trev.norris@gmail.com>
Reviewed-by: Fedor Indutny <fedor@indutny.com>
2014-09-17 14:16:29 -07:00
Guilherme de Souza 468fb547bb doc: http.request() improved code example
Reviewed-by: Trevor Norris <trev.norris@gmail.com>
Reviewed-by: Fedor Indutny <fedor@indutny.com>
2014-09-17 12:19:05 -07:00
Timothy J Fontaine 7ca5af87a0 Merge remote-tracking branch 'upstream/v0.10' into v0.12
Conflicts:
	ChangeLog
	deps/v8/src/hydrogen.cc
	lib/http.js
	lib/querystring.js
	src/node_crypto.cc
	src/node_version.h
	test/simple/test-querystring.js
2014-09-16 17:48:09 -07:00
Timothy J Fontaine 84952da241 Now working on 0.10.33 2014-09-16 16:53:10 -07:00
Timothy J Fontaine 1a8b0e807f Merge branch 'v0.10.32-release' into v0.10 2014-09-16 16:52:57 -07:00
Timothy J Fontaine 0fe0d12155 2014.09.16, Version 0.10.32 (Stable)
* npm: Update to 1.4.28

* v8: fix a crash introduced by previous release (Fedor Indutny)

* configure: add --openssl-no-asm flag (Fedor Indutny)

* crypto: use domains for any callback-taking method (Chris Dickinson)

* http: do not send `0rnrn` in TE HEAD responses (Fedor Indutny)

* querystring: fix unescape override (Tristan Berger)

* url: Add support for RFC 3490 separators (Mathias Bynens)
2014-09-16 15:47:52 -07:00
Timothy J Fontaine daca803e9e npm: Update to 1.4.28 2014-09-16 15:38:50 -07:00
Fedor Indutny 1fddc1fee8 http: do not send `0\r\n\r\n` in TE HEAD responses
When replying to a HEAD request, do not attempt to send the trailers and
EOF sequence (`0\r\n\r\n`). The HEAD request MUST not have body.

Quote from RFC:

The presence of a message body in a response depends on both the
request method to which it is responding and the response status code
(Section 3.1.2).  Responses to the HEAD request method (Section 4.3.2
of [RFC7231]) never include a message body because the associated
response header fields (e.g., Transfer-Encoding, Content-Length,
etc.), if present, indicate only what their values would have been if
the request method had been GET (Section 4.3.1 of [RFC7231]).

fix #8361

Reviewed-By: Timothy J Fontaine <tjfontaine@gmail.com>
2014-09-16 15:24:19 -07:00
Chris Dickinson 6e689ece46 crypto: use domains for any callback-taking method
This adds domains coverage for pdbkdf2, pseudoRandomBytes, and randomBytes.
All others should be covered by event emitters.

Fixes #5801.

Reviewed-By: Timothy J Fontaine <tjfontaine@gmail.com>
2014-09-16 15:23:04 -07:00
Ben Noordhuis 21e60643b0 lib, src: add vm.runInDebugContext()
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>
2014-09-16 12:28:47 -07:00
Maciej Małecki 174f7d2820 dns: include host name in error message if available
This makes errors more readable and similar to FS errors, which also
include file name.

Reviewed-By: Fedor Indutny <fedor@indutny.com>
2014-09-16 15:32:04 +04:00
Maciej Małecki 0664ddc093 doc: document `process.env` better
Fixes #6424.

Reviewed-By: Fedor Indutny <fedor@indutny.com>
2014-09-16 02:41:38 +04:00
Adam Lippai 11d57a535c tls: fix encoding in certificate-related functions
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
2014-09-15 17:42:20 +04:00
Mathias Schreck 7c5fabe405 doc: fix modules require.resolve documentation
The behavior of the `node_modules` lookup algorithm was
changed in #1177, but the documentation was not updated completely
to describe the new behavior.

The pseudocode of the lookup algorithm did not metion that
`index.json` is tried to be loaded if you require a folder.

Reviewed-By: Fedor Indutny <fedor@indutny.com>
2014-09-15 17:17:05 +04:00
Fedor Indutny 630f0c4660 deps: backport 60c316 from v8 trunk
Original commit message:

    Extend the interceptor setter ASSERT to support the JSGlobalProxy case.

    BUG=v8:3463
    LOG=n
    R=dcarney@chromium.org

    Review URL: https://codereview.chromium.org/415973004

    git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@22589 ce2b1a6d-e550-0410-aec6-3dcde31c8c00

    Signed-off-by: Fedor Indutny <fedor@indutny.com>

fix #7969
2014-09-09 16:52:46 -07:00
Fedor Indutny f3836af2f8 gyp: fix post-mortem in v0.11
Expose missing constants and keep symbols on OSX.
2014-09-09 16:52:45 -07:00
Ben Noordhuis 8d9493c315 deps: cherry-pick r21466 from v8 trunk
Check for cached transition to ExternalArray elements kind.
See [1] and [2] for details.

[1] https://code.google.com/p/v8/issues/detail?id=3337
[2] https://codereview.chromium.org/291193011

Signed-off-by: Fedor Indutny <fedor@indutny.com>
2014-09-09 16:52:45 -07:00
Ben Noordhuis b8a8e5558d deps: cherry-pick r21297 from v8 trunk
Changes the return value of PropertyCallbackInfo<T>::This() from
Local<Value> back to Local<Object>.  See [1] and [2] for background.

[1] https://groups.google.com/forum/#!topic/v8-users/wP2UcQ4cBW4
[2] https://codereview.chromium.org/285643008/

Signed-off-by: Fedor Indutny <fedor@indutny.com>
2014-09-09 16:52:45 -07:00
Ben Noordhuis 6f07d2fa1b deps: fix up v8 postmortem codegen
Signed-off-by: Fedor Indutny <fedor@indutny.com>
2014-09-09 16:52:45 -07:00
Trevor Norris f9ce97084c v8: Upgrade 3.26.33 with 14 patches
V8 3.26.31 has received 14 patches since the upgrade to 3.26.33. Since
3.26.33 is technically a tag on the 3.27 branch, reverting back to
3.26.31 would remove now default functionality like WeakMaps. Because of
that the patches have simply been cherry-picked and squashed.

Here is a summary of all patches:

* Fix index register assignment in LoadFieldByIndex for arm, arm64, and
  mips.
* Fix invalid attributes when generalizing because of incompatible map
  change.
* Skip write barriers when updating the weak hash table.
* MIPS: Avoid HeapObject check in HStoreNamedField.
* Do GC if CodeRange fails to allocate a block.
* Array.concat: properly go to dictionary mode when required.
* Keep CodeRange::current_allocation_block_index_ in range.
* Grow heap slower if GC freed many global handles.
* Do not eliminate bounds checks for "<const> - x".
* Add missing map check to optimized f.apply(...).
* In GrowMode, force the value to the right representation to avoid
  deopts between storing the length and storing the value.
* Reduce max executable size limit.
* Fix invalid condition in check elimination effects.
* Fix off-by-one error in Array.concat slow mode check.

For more information see: https://github.com/v8/v8/commits/3.26

Reviewed-By: Fedor Indutny <fedor@indutny.com>
2014-09-09 16:52:10 -07:00
Trevor Livingston bf5e2f246e tls: `checkServerIdentity` option
Allow overriding `checkServerIdentity` function, when connecting to a
TLS server.

Reviewed-By: Fedor Indutny <fedor@indutny.com>
2014-09-09 17:15:50 +01:00
Ben Noordhuis 06526a2a93 src: remove Environment::GetCurrentChecked()
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>
2014-09-05 09:54:10 -07:00
Ben Noordhuis 299cf84490 lib: unexport http.parsers
Unexport the http.parsers freelist.  It was originally exported by Ryan
in commit 0003c701 but the commit log doesn't mention why and it's never
been documented.  It's unclear if there are any users.

The lifecycle of parser objects changed recently and it seems better to
not let people shoot themselves in the foot so easily.

If it turns out there are actually users, we can always re-export it
again - probably under a slightly different name, to force people to
update their code to the new way of things.

Reviewed-by: Trevor Norris <trev.norris@gmail.com>
2014-09-05 09:34:43 -07:00
Ben Noordhuis 150d6f1249 lib: http: poison parser references after freeing
Make it a little harder to slip in use-after-free bugs by nulling out
references to the parser object after handing it off to freeParser().

Reviewed-by: Trevor Norris <trev.norris@gmail.com>
2014-09-05 09:34:37 -07:00
Ben Noordhuis 8e6706ea95 src: update and expand comments in base-object.h
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>
2014-09-05 09:34:27 -07:00
Ben Noordhuis b33a47ef47 lib, src: don't make http parser handles weak
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>
2014-09-05 09:34:15 -07:00
Ben Noordhuis 1e99486cc8 src: add ClearWrap() to util.h
Counterpart to Wrap(), clears the previously assigned internal field.
Will be used in an upcoming commit.

Reviewed-by: Trevor Norris <trev.norris@gmail.com>
2014-09-05 09:33:58 -07:00
Ben Noordhuis de9a444ab4 src: fix handle leak in Parser::Execute()
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>
2014-09-05 09:33:49 -07:00
Majid Arif Siddiqui 176f0bd3df lib: improved forEach object performance
Reviewed-by: Trevor Norris <trev.norris@gmail.com>
2014-09-05 09:19:32 -07:00
cjihrig 86bb7fa5cd test: listen on exclusive port in cluster workers
Test that listening on exclusive ports with the cluster module works
correctly.

Reviewed-by: Trevor Norris <trev.norris@gmail.com>
2014-09-04 15:18:48 -07:00
cjihrig 029cfc12a0 net,dgram: workers can listen on exclusive ports
Allow cluster workers to listen on exclusive ports for TCP and UDP,
instead of forcing all calls to go through the cluster master.

Fixes: #3856
Reviewed-by: Trevor Norris <trev.norris@gmail.com>
Reviewed-by: Fedor Indutny <fedor@indutny.com>
2014-09-03 15:16:16 -07:00
Trevor Norris 9b8837b355 src: be more intelligent about use of "arguments"
Use 'use strict' when there are named arguments and the arguments object
is passed to apply(). Also pass named arguments to call() when the named
argument is modified by the function.

Suggested in
https://github.com/joyent/node/pull/8302#issuecomment-54331801

Confirmed in
https://github.com/joyent/node/pull/8302#issuecomment-54364818

Signed-off-by: Trevor Norris <trev.norris@gmail.com>
2014-09-03 14:24:50 -07:00
Fedor Indutny 73631bbcc8 tls: support multiple keys/certs
Required to serve website with both ECDSA/RSA certificates.
2014-09-03 17:36:54 +04:00