Commit Graph

8899 Commits (222e5239fc5fc699cc5b4c2aa34377a52c699670)

Author SHA1 Message Date
isaacs 9fc9b87472 http: Proper KeepAlive behavior
Instead of destroying sockets when there are no pending requests, put
them in a freeSockets list, and unref() them so that they do not keep
the event loop open.

Also, set the default max sockets to Infinity, to prevent the awful
surprising deadlocks that happen when more connections are made.
2013-07-09 22:31:11 -07:00
isaacs 6176e49181 http: style 2013-07-09 22:31:11 -07:00
Nathan Rajlich 48e159faf2 crypto: throw a helpful error message for "tls" and "crypto"
When node is compiled with the --without-ssl flag.
2013-07-09 11:27:38 -07:00
Nathan Rajlich 567c72b8c5 configure: fix the --without-ssl option
Closes #5807.
2013-07-09 11:27:37 -07:00
Trevor Norris b8ce1da74d buffer: propagate originating parent
When creating a slice, make sure to propagate the originating parent.
This is to prevent a buf.parent.parent.(etc) scenario.

Also speed up the constructor by preventing lookup of non-existant
properties by setting them beforehand in the prototype. (see
https://github.com/joyent/node/commit/7ce5a31#commitcomment-3332779)
2013-07-08 23:12:52 -07:00
Timothy J Fontaine 2fc34d75d9 tls_wrap: return Error not throw for missing cert 2013-07-09 00:13:02 +00:00
Trevor Norris 22668db73d benchmark: update callbacks only receive data
Since the SlabAllocator was removed the buffer length/offset is no
longer sent to the onread callback. The benchmarks have been updated to
reflect that.
2013-07-08 16:53:41 -07:00
Trevor Norris ead8e26b5b smalloc: call callback if set on AllocDispose
Fix bug where if dev passed a callback to Alloc then called AllocDispose
it wouldn't bother to pass the data to the callback and instead would
just free it.
2013-07-08 11:09:09 -07:00
Trevor Norris aa8c4a0766 smalloc: zero size allocs may need to be free'd
Zero size allocations don't necessarily mean that data == NULL. So
instead check each value seperately and perform necessary operations.
2013-07-08 09:17:22 -07:00
Ben Noordhuis 58e4edaf68 deps: upgrade c-ares to piscisaureus/cares@805d153
This should fix the Android build.
2013-07-06 22:20:29 +02:00
Peter Rust 82ff891e22 http: use an unref'd timer to fix delay in exit
There was previously up to a second exit delay when exiting node
right after an http request/response, due to the utcDate() function
doing a setTimeout to update the cached date/time.

Fixing this should increase the performance of our http tests.
2013-07-07 21:12:07 -07:00
Timothy J Fontaine fe176929c2 timers: internal unref timers should use Timer.now 2013-07-07 18:25:48 -07:00
Ben Noordhuis 0181fee411 build: don't enable --gc-sections on sunos
The SunOS linker doesn't support it. Fixes build breakage introduced
in commit 9b3de60.
2013-07-06 18:49:02 +02:00
Ben Noordhuis 7684e0b554 test: fix up weakref.cc after v8 api change 2013-07-06 17:44:45 +02:00
Ben Noordhuis d2d07421ca tools: add check-imports.sh script
Checks that `using` statements in src/*.cc are properly sorted and
actually used.
2013-07-06 17:44:45 +02:00
Ben Noordhuis 0693d22f86 src: enable native v8 typed arrays
This commit removes our homegrown typed arrays implementation and
enables V8's built-in typed arrays implementation.
2013-07-06 17:44:45 +02:00
Ben Noordhuis c56a96c25c src: abort() on fatal error in debug mode
abort() generates a nice core dump and makes it easy to catch fatal
errors in one's debugger of choice.
2013-07-06 17:44:44 +02:00
Ben Noordhuis 8985bb8bfd string_bytes: stop using String::AsciiValue
Debug builds of V8 now actively check that the string only contains
ASCII characters (i.e. doesn't contain bytes with the high bit set.)
2013-07-06 17:44:44 +02:00
Ben Noordhuis 110a9cd8db lib, src: upgrade after v8 api change
This is a big commit that touches just about every file in the src/
directory. The V8 API has changed in significant ways. The most
important changes are:

* Binding functions take a const v8::FunctionCallbackInfo<T>& argument
  rather than a const v8::Arguments& argument.

* Binding functions return void rather than v8::Handle<v8::Value>. The
  return value is returned with the args.GetReturnValue().Set() family
  of functions.

* v8::Persistent<T> no longer derives from v8::Handle<T> and no longer
  allows you to directly dereference the object that the persistent
  handle points to. This means that the common pattern of caching
  oft-used JS values in a persistent handle no longer quite works,
  you first need to reconstruct a v8::Local<T> from the persistent
  handle with the Local<T>::New(isolate, persistent) factory method.

A handful of (internal) convenience classes and functions have been
added to make dealing with the new API a little easier.

The most visible one is node::Cached<T>, which wraps a v8::Persistent<T>
with some template sugar. It can hold arbitrary types but so far it's
exclusively used for v8::Strings (which was by far the most commonly
cached handle type.)
2013-07-06 17:44:44 +02:00
Ben Noordhuis 9b3de60d35 build: remove --unsafe-optimizations flag
The previous commit removes our patch that builds V8 at -O2 rather
than -O3 so there is not much point in keeping the configure switch
around.

The reason it did so was to work around an assortment of compiler and
linker bugs. In particular, certain combinations of g++ and binutils
generate bad or no code when -ffunction-sections or -finline-functions
is enabled (which -O3 implicitly does.)

It was quite the problem back in the day because everyone and his dog
built from source. Now that we have prebuilt binaries and packages
available, there is no longer a pressing need to be so accommodating.

If you experience spurious (or possibly not so spurious) segmentation
faults after this commit, you need to upgrade your compiler/linker
toolchain.
2013-07-06 16:53:07 +02:00
Ben Noordhuis 588040d20d v8: reapply floating patches 2013-07-06 16:53:06 +02:00
Ben Noordhuis 704fd8f374 v8: upgrade to v3.20.2 2013-07-06 16:53:06 +02:00
Trevor Norris eec43351c4 smalloc: revert change to use pointer indirection
Better to compare fixed addresses than to use pointer indirection.
2013-07-06 15:05:04 -07:00
Fedor Indutny f0a05e4bc3 buffer: use macro 2013-07-06 15:55:46 +04:00
Fedor Indutny 28609d1779 smalloc: fix style, use macro 2013-07-06 03:52:30 +04:00
Trevor Norris 71ade1c212 doc: remove mention of maxTickDepth
maxTickDepth has been removed, but mention of it was left in the docs.
Also added explanation that nextTick is allowed to starve I/O.
2013-07-05 15:14:10 -07:00
Tim Oxley 2d6d46172e doc: remove obsolete spawn() stdio options 2013-07-05 11:56:24 +02:00
Ben Noordhuis 30e7d08d93 Merge remote-tracking branch 'origin/v0.10'
Conflicts:
	lib/buffer.js
	lib/http.js
	src/node.cc
2013-07-05 02:40:39 +02:00
Ben Noordhuis 806e300878 src: fix memory leak in UsingDomains()
UsingDomains() assigned process_tickCallback when it had already
been set by MakeCallback() a few frames down the call stack.

Dispose the handle first or we'll retain whatever is in the lexical
closure of the old process._tickCallback function.

Fixes #5795.
2013-07-05 02:20:39 +02:00
Jeff Barczewski 26ca7d73ca stream: objectMode transform should allow falsey values
If a transform stream has objectMode = true, it should
allow falsey values other than (null) like 0, false, ''.

null is reserved to indicate stream eof but other falsey
values should flow through properly.
2013-07-03 15:07:01 -07:00
Trevor Norris 278183a902 {stream,udp,tls}_wrap: remove unused offset/length
The function arguments offset and length are now no longer used since
all I/O requests now use discretely allocated memory.
2013-07-03 15:03:41 -07:00
Trevor Norris fa10b757f5 smalloc: use malloc instead of new
To use realloc the implementation had to be changed to use malloc/free.
2013-07-03 15:03:24 -07:00
Trevor Norris ec90e6e80a slab_allocator: remove SlabAllocator
Now that Buffer instantiation has improved, the SlabAllocator is an
unnecessary layer of complexity preventing further performance
optimizations.

Currently there is a small performance loss with very small stream
requests, but this will soon be addressed.
2013-07-03 14:56:27 -07:00
Fedor Indutny c1db1ecd15 crypto: fix memory leak in LoadPKCS12
X509_STORE_add_cert increment reference of passed `x509` cert,
`X509_free` must be called to avoid memory leak.
2013-07-03 16:16:44 +04:00
Fedor Indutny 07fbb43d78 tls: export TLSSocket 2013-07-03 16:15:31 +04:00
Timothy J Fontaine 4c38742dd8 test: fix tls-hello-parser-failure on smartos
Assert that when the client closes it has seen an error, this prevents
the test from timing out.

Also queue a second write in the case that we were able to send the
buffer before the other side closed the connection.
2013-07-01 17:41:38 -07:00
Peter Rust 16b59cbc74 http: use an unref'd timer to fix delay in exit
There was previously up to a second exit delay when exiting node
right after an http request/response, due to the utcDate() function
doing a setTimeout to update the cached date/time.

Fixing this should increase the performance of our http tests.
2013-07-01 16:02:25 -07:00
Timothy J Fontaine 6f8ddf3759 test: fix tls-hello-parser-failure on smartos
Assert that when the client closes it has seen an error, this prevents
the test from timing out.

Also queue a second write in the case that we were able to send the
buffer before the other side closed the connection.
2013-07-01 15:04:56 -07:00
Brian White dc3c2d12c8 zlib: level can be negative
This is a back-port of commit e945903 from the master branch.
2013-07-01 19:37:50 +02:00
Brian White 95dcd11dde zlib: allow zero values for level and strategy
This is a back-port of commit c9644fb from the master branch.
2013-07-01 19:37:29 +02:00
Brian White 9b09c9eedd zlib: allow changing of level and strategy 2013-07-01 13:08:09 +02:00
Brian White 086d4ccace zlib: allow custom flush type for flush() 2013-07-01 13:08:09 +02:00
Brian White 0004ffa5da zlib: remove unused parameter 2013-07-01 13:08:09 +02:00
Brian White e945903671 zlib: level can be negative 2013-07-01 13:08:09 +02:00
Brian White c9644fbd7c zlib: allow zero values for level and strategy 2013-07-01 13:08:09 +02:00
Ben Noordhuis 9290385057 doc: vm: update github issues link 2013-06-28 12:31:37 +02:00
Ben Noordhuis cf6acf2a1a buffer: add comment explaining buffer alignment
Avoids alignment issues (unaligned loads/stores) on ARM. Originally
added in commit 285d8c6.

Fixes #3030.
2013-06-27 03:22:05 +02:00
isaacs 2a8c5ddc46 blog: v0.11.3 release 2013-06-26 17:06:51 -07:00
isaacs 0449c3d0cb Merge branch 'v0.11.3-release' 2013-06-26 16:55:46 -07:00
Ben Noordhuis c1bf89df2e doc: tls: ECDH ciphers are not supported 2013-06-27 01:37:39 +02:00