0
0
mirror of https://github.com/nodejs/node.git synced 2024-11-22 07:37:56 +01:00
Commit Graph

9324 Commits

Author SHA1 Message Date
Ben Noordhuis
a12870c823 crypto: update root certificates
Update the list of root certificates in src/node_root_certs.h with
tools/mk-ca-bundle.pl and update src/node_crypto.cc to make use of
the new format.

Fixes #6013.
2013-11-09 23:46:07 +01:00
Ben Noordhuis
d4c09f20c8 tools: check in certdata.txt from mozilla NSS
This is a file from the NSS project containing root certificate data.
It can be downloaded from:

  https://mxr.mozilla.org/mozilla/source/security/nss/lib/ckfw/builtins/certdata.txt?raw=1

Once downloaded, running `perl tools/mk-ca-bundle.pl` will update
src/node_root_certs.h.  Commit, rebuild and go.
2013-11-09 23:37:55 +01:00
Ben Noordhuis
e159073da5 tools: customize mk-ca-bundle.pl
Remove unneeded functionality and tweak the generated output so we
can #include it in C++ source code.
2013-11-09 23:37:16 +01:00
Ben Noordhuis
5ab863de22 tools: bundle mk-ca-bundle.pl from upstream curl 2013-11-09 23:01:27 +01:00
isaacs
a48b647162 Merge remote-tracking branch 'ry/v0.10' 2013-11-08 13:41:44 -08:00
isaacs
8f221bc43d npm: Upgrade to 1.3.14 2013-11-08 13:41:24 -08:00
Ben Noordhuis
146b2e267b build: make v8 use random seed for hash tables
Upstream V8 as of commit v8/v8@4bc70e8 uses a fixed seed of 314159265
for hash tables unless instructed otherwise.  Tell V8 to keep using a
random seed.
2013-11-08 22:26:50 +01:00
Ben Noordhuis
0619467bd3 src: remove container_of, use CONTAINER_OF
CONTAINER_OF was introduced a while ago but was not used consistently
everywhere yet.  This commit fixes that.

Why CONTAINER_OF instead of container_of?  The former makes it crystal
clear that it's a macro, not a function.
2013-11-08 22:26:23 +01:00
Ben Noordhuis
3facd4e1dc crypto: unbreak build with no-NPN shared openssl
Unbreak the build when linking against a shared version of OpenSSL that
doesn't support NPN (Next Protocol Negotiation.)

Fixes the following build error:

  ../src/node_crypto.cc:140: error: no member function
  'AdvertiseNextProtoCallback' declared in
  'node::crypto::SSLWrap<node::TLSCallbacks>'
  ../src/node_crypto.cc:147: error: no member function
  'SelectNextProtoCallback' declared in
  'node::crypto::SSLWrap<node::TLSCallbacks>'
2013-11-08 17:50:01 +01:00
Fedor Indutny
014ab77276 crypto: try moving read head in Peek()
Otherwise it might get stall (`Peek()` will return zero-length chunk)
in following situation:

1. `Write(kBufferLength)`
2. `Read(kBufferLength)`
3. `Write(anything)`
4. `Peek()` => `len=0`
2013-11-08 17:01:02 +04:00
Fedor Indutny
0be5a94c56 doc: encoding is ignored if input is a Buffer
NOTE: it wasn't in 0.8

fixes #6386
2013-11-07 11:02:19 -08:00
isaacs
ea8feced87 http: force socket encoding to be null
Otherwise the string triggers an assertion error in node_http_parser.c,
line 370:

    assert(Buffer::HasInstance(args[0]) == true);

because the first argument is not a Buffer object.
2013-11-07 08:24:50 -08:00
Ben Noordhuis
10cf8ade63 doc: cluster: bump stability level to 'unstable'
As discussed on the mailing list: the module will not go away but the
API will continue to receive updates as the need arises.

Link: https://groups.google.com/forum/#!topic/nodejs/uqyTcQfimAI
Message-ID: <7384b30e-b64c-4086-b78f-b5acca9842a9@googlegroups.com>
2013-11-07 12:38:00 +01:00
fengmk2
1ce5db4d95 http: cleanup freeSockets when socket destroyed
If the socket was destroyed, we need to remove it from the agent's
`freeSockets` list, otherwise dead socket could be reused by new
request.
2013-11-07 11:42:41 +04:00
Jackson Tian
60958d235d benchmark: Correct the bufferSize to highWaterMark
The bufferSize has been removed. Use highWaterMark instead of.
2013-11-06 16:32:22 +04:00
Fedor Indutny
a6ddfe20d2 tls: more accurate wrapping of connecting socket
When socket, passed in `tls.connect()` `options` argument is not yet
connected to the server, `_handle` gets assigned to a `net.Socket`,
instead of `TLSSocket`.

When socket is connecting to the remote server (i.e. not yet connected,
but already past dns resolve phase), derive `_connecting` property from
it, because otherwise `afterConnect()` will throw an assertion.

fix #6443
2013-11-05 18:14:28 +04:00
Ben Noordhuis
515607a740 fs: make fs.watch() non-recursive by default
Fixes a behavioral regression introduced in commit 691b9eb.
2013-11-05 08:27:05 +01:00
Ben Noordhuis
7acdabbf50 src: fix whitespace/braces lint error from 962686b
Silly warning.  One day I'll probably remove it altogether, see if I
don't.
2013-11-04 22:44:22 +01:00
Nathan Rajlich
9bc53d887a http: make DELETE requests set req.method
Fixes #6461.
2013-11-04 09:39:29 -08:00
Ben Noordhuis
962686b67b src: squelch unused variable warning
|i| and |j| arent't used when building without crypto support.  Hat tip
to Brian White.

Rename |l| to |k| while we're here because it's quite hard to discern
from |i| or |j| with some fonts.
2013-11-03 21:06:46 +01:00
isaacs
849c92fec7 doc: Correct and add several items
Several names/urls were out of date, and some really
awesome stuff was missing.
2013-10-31 13:36:00 -07:00
Sam Roberts
155df9ca76 doc: document node signal handling
Partly lifted from uv.h, partly from observation of node.cc.
2013-10-31 21:19:04 +01:00
Timothy J Fontaine
9f7f9d1240 blog: Post for v0.11.8 2013-10-30 09:09:04 -07:00
Erik Dubbelboer
bb909ad642 tls: add ECDH ciphers support
Switch test fixtures to 1024 bit keys.
2013-10-30 08:34:47 +01:00
Trevor Norris
d2a600200e test: fix async listener test for windows 2013-11-01 16:36:23 -07:00
Ben Noordhuis
df3537102b benchmark: add http chunked encoding benchmarks
Test both "Content-Length: xxx" and "Transfer-Encoding: chunked" responses in
the http/simple benchmark.
2013-11-01 15:44:44 +01:00
Trevor Norris
fe4fbc2a1e doc: add docs for AsyncListeners
Documentation has been added on how to use the AsyncListener API.
2013-10-31 17:10:39 -07:00
Jacob Groundwater
005cc05a56 test: add additional async listener tests 2013-10-31 17:10:23 -07:00
Trevor Norris
bc39bdd995 domain: use AsyncListener API
The domain module has been switched over to use the domain module API as
much as currently possible. There are still some hooks in the
EventEmitter, but hopefully we can remove those in the future.
2013-10-31 16:34:35 -07:00
Trevor Norris
fbe7eec1ec cares: add AsyncListener support 2013-10-31 16:34:35 -07:00
Trevor Norris
95c38107c2 crypto: convert pbkdf2_req to a class
pbkdf2_req has been renamed to PBKDF2Request and converted to a class.
It now uses AsyncWrap::MakeCallback.

Also includes, using env()->ondone_string() instead of "ondone" and
using malloc instead of new char[].
2013-10-31 16:34:35 -07:00
Trevor Norris
66d908f09a crypto: convert RandomBytesRequest to a class
Since RandomBytesRequest makes a call to MakeCallback, needed it to be
a class so AsyncWrap could handle any async listeners.

Also added a simple test for an issue had during implementation where
the memory was being released and returned.
2013-10-31 16:34:35 -07:00
Trevor Norris
ccec14b568 async-wrap: add methods to udp/tcp/pipe/timers
Now it's possible to add/remove an async listener to an individual
handle created by UDP, TCP, Pipe or Timer.
2013-10-31 16:34:11 -07:00
Trevor Norris
8b8e3b6798 async-wrap: integrate with WeakObject
Making WeakObject inherit from AsyncWrap allows us to peak into almost
all the MakeCallback calls in Node internals.
2013-10-31 14:17:51 -07:00
Trevor Norris
efa62fd9cc node: add AsyncListener support
AsyncListener is a JS API that works in tandem with the AsyncWrap class
to allow the user to be alerted to key events in the life cycle of an
asynchronous event. The AsyncWrap class has its own MakeCallback
implementation that core will be migrated to use, and uses state sharing
techniques to allow quicker communication between JS and C++ whether the
async event callbacks need to be called.
2013-10-31 14:17:51 -07:00
Fedor Indutny
21fbbd5790 test: fix tls-client-reject after ba7c9ce96 2013-10-31 23:39:43 +04:00
Ben Noordhuis
c4def505cb build: use zero overhead systemtap probes
Profiling suggested that on Linux sometimes over 10% of CPU time was
being spent inside the systemtap probe entry points in the binding
layer, even when the process was not actively being traced with the
`stap` tool.

That's why this commit makes it possible to use the *_ENABLED() macros
and bail out early when we're not being traced, reducing the overhead
of unused probes to (almost) zero.

Said macros were already being generated by `dtrace -h` but were not
usable because they rely on external definitions.  To remedy that, we
now generate the accompanying object files with `dtrace -G`.

This commit includes a change to libuv that has been landed upstream in
commit joyent/libuv@3c172ea.
2013-10-29 21:55:48 +01:00
Fedor Indutny
ba7c9ce964 tls: do not default to 'localhost' servername 2013-10-31 01:57:20 +04:00
Fedor Indutny
5977cba985 tls: reuse hostname from underlying net.Socket
When `tls.connect()` is called with `socket` option, it should try to
reuse hostname previously passed to `net.connect()` and only after that
fall back to `'localhost'`.

fix #6409
2013-10-31 01:57:17 +04:00
Nick Simmons
691b9ebc8c fs: add recursive subdirectory support to fs.watch
Currently fs.watch does not have an option to specify if a directory
should be recursively watched for events across all subdirectories.

Several file watcher APIs support this. FSEvents on OS X > 10.5 is
one example. libuv has added support for FSEvents, but fs.watch had
no way to specify that a recursive watch was required.

fs.watch now has an additional boolean option 'recursive'. When set
to true, and when supported, fs.watch will return notifications for
the entire directory tree hierarchy rooted at the specified path.
2013-10-31 01:13:44 +04:00
Timothy J Fontaine
bae4c907bc Now working on 0.11.9 2013-10-30 08:55:06 -07:00
Timothy J Fontaine
e98d8a3eb2 Merge branch 'v0.11.8-release' 2013-10-30 08:54:48 -07:00
Timothy J Fontaine
f8d86e24f3 2013.10.30, Version 0.11.8 (Unstable)
* uv: Upgrade to v0.11.14

* v8: upgrade 3.21.18.3

* assert: indicate if exception message is generated (Glen Mailer)

* buffer: add buf.toArrayBuffer() API (Trevor Norris)

* cluster: fix premature 'disconnect' event (Ben Noordhuis)

* crypto: add SPKAC support (Jason Gerfen)

* debugger: count space for line numbers correctly (Alex Kocharin)

* debugger: make busy loops SIGUSR1-interruptible (Ben Noordhuis)

* debugger: repeat last command (Alex Kocharin)

* debugger: show current line, fix for #6150 (Alex Kocharin)

* dgram: send() can accept strings (Trevor Norris)

* dns: rename domain to hostname (Ben Noordhuis)

* dns: set hostname property on error object (Ben Noordhuis)

* dtrace, mdb_v8: support more string, frame types (Dave Pacheco)

* http: add statusMessage (Patrik Stutz)

* http: expose supported methods (Ben Noordhuis)

* http: provide backpressure for pipeline flood (isaacs)

* process: Add exitCode property (isaacs)

* tls: socket.renegotiate(options, callback) (Fedor Indutny)

* util: format as Error if instanceof Error (Rod Vagg)
2013-10-29 17:08:07 -07:00
Timothy J Fontaine
74a664b22f fs_event_wrap: update to new libuv api 2013-10-29 16:46:15 -07:00
Timothy J Fontaine
a35a212f25 uv: Upgrade to v0.11.14 2013-10-29 16:33:17 -07:00
Trevor Norris
613d76ef6a src: shorten Object{Wrap,Unwrap}
Going back to the original names of Wrap/Unwrap now that most all the
class members that duplicate the name and functionality have been
removed.
2013-10-29 15:09:44 -07:00
Trevor Norris
f2e3be53bc src: don't use class specific Unwrap methods
Instead use the template functions in util.h.
2013-10-29 15:09:44 -07:00
Trevor Norris
60a3e695cb src: don't use WeakObject::Unwrap
Switch out to use UnwrapObject from util.h.
2013-10-29 15:09:44 -07:00
Trevor Norris
93f75a86bf src: use function to get internal pointer
Remove the NODE_{WRAP,UNWRAP} macros and instead use template functions.
2013-10-29 15:09:44 -07:00
Trevor Norris
4b84e42f67 node: don't share state with in_tick/last_threw
There was no need to share state between C++ and JS for these two
values. So they have been moved to their respective locations. This will
help performance only a tiny bit, but it does help code complexity much
more.
2013-10-29 15:09:44 -07:00