Ben Noordhuis [Tue, 27 Aug 2013 14:14:45 +0000 (16:14 +0200)]
src: remove two pointless globals from node.cc
De-globalize use_npn and use_sni, they're only used in GetFeatures().
Ben Noordhuis [Tue, 27 Aug 2013 12:47:46 +0000 (14:47 +0200)]
src: call uv_loop_delete() on exit in debug mode
Should make tracing with valgrind a little easier on the eye and
possibly help expose libuv handle lifecycle issues.
Ben Noordhuis [Tue, 27 Aug 2013 12:09:36 +0000 (14:09 +0200)]
src: remove --max-stack-size option
Ad-hoc duplicate of V8's --stack-size option. Superfluous in other
words. Remove it.
Ben Noordhuis [Tue, 27 Aug 2013 11:20:39 +0000 (13:20 +0200)]
cares_wrap: drop UV_HANDLE_FIELDS from ares_task_t
UV_HANDLE_FIELDS is a libuv implementation detail. The ares_task_t
struct only uses the uv_loop_t* field so be explicit about that.
Ben Noordhuis [Mon, 26 Aug 2013 22:13:50 +0000 (00:13 +0200)]
src: fix up unused/unordered imports
Trevor Norris [Mon, 26 Aug 2013 10:26:31 +0000 (03:26 -0700)]
buffer: fix assert fail from JS API
Length arguments passed to SlowBuffer were coerced to Int32, not Uint32,
so passing a negative number would throw the following:
node: ../src/smalloc.cc:244: void node::smalloc::Alloc(): Assertion `length <= kMaxLength' failed.
Aborted (core dumped)
That has been fixed by coercing to Uint32 and comparing the value
against kMaxLength.
Trevor Norris [Mon, 26 Aug 2013 10:20:23 +0000 (03:20 -0700)]
buffer: add NativeBuffer API
Due to a lot of the util.is* checks there was much unnecessary overhead
for the most common use case of Buffer. Which is creating a new Buffer
instance for data from incoming I/O. NativeBuffer is a simple way to
bypass all the unneeded checks and simply hand back a Buffer instance
while setting the length.
Ben Noordhuis [Mon, 26 Aug 2013 13:13:35 +0000 (15:13 +0200)]
src: remove pointless node_os.h header file
src/node_os.cc doesn't export anything that's used elsewhere. Remove it.
Bert Belder [Sun, 25 Aug 2013 16:44:57 +0000 (18:44 +0200)]
process_wrap: don't coerce process exit code to int32_t
On windows process exit codes can be greater than INT32_MAX. This used
to be not much of a problem - greater values would just come out
negative. However since ca9eb71 a negative result value indicates that
uv_spawn() has failed, so this is no longer acceptable.
Bert Belder [Sat, 24 Aug 2013 17:47:45 +0000 (19:47 +0200)]
uv: upgrade to v0.11.10
Trevor Norris [Wed, 21 Aug 2013 23:12:17 +0000 (16:12 -0700)]
domain: move error handling directly into instance
Instead of doing all the domain handling in core, allow the domain to
set an error handler that'll take care of it all. This way the domain
error handling can be abstracted enough for any user to use it.
Bert Belder [Fri, 23 Aug 2013 17:08:49 +0000 (19:08 +0200)]
process_wrap: update after libuv api change
The `exit_code` argument for the `ProcessWrap::OnExit` callback changed
from int to int64_t.
Bert Belder [Fri, 23 Aug 2013 17:04:27 +0000 (19:04 +0200)]
uv: upgrade to v0.11.9
Ben Noordhuis [Fri, 23 Aug 2013 00:01:29 +0000 (02:01 +0200)]
vm: fix Persistent<Context> leak
Ben Noordhuis [Fri, 23 Aug 2013 12:29:57 +0000 (14:29 +0200)]
vm: remove unnecessary Persistent<FunctionTemplate>
Ben Noordhuis [Fri, 23 Aug 2013 10:00:28 +0000 (12:00 +0200)]
buffer: fix regression in Buffer(buf) constructor
Commit
3a2f273b got the source and the target wrong when copying over
the data. Fix that and add a regression test.
Fixes #6111.
Timothy J Fontaine [Thu, 22 Aug 2013 01:38:23 +0000 (18:38 -0700)]
util: pass opts to custom inspect functions
Objects with custom inpsect functions should get the options that were
passed to `util.inspect()`
fixes #5822
fixes #6098
Trevor Norris [Thu, 22 Aug 2013 05:18:20 +0000 (22:18 -0700)]
buffer: fix inspect throw if slice length too long
All the Buffer#{ascii,hex,etc.}Slice() methods are intentionally strict
to alert if a Buffer instance was attempting to be accessed out of
bounds. Buffer#toString() is the more user friendly way of accessing the
data, and will coerce values to their min/max on overflow.
Timothy J Fontaine [Thu, 22 Aug 2013 01:17:11 +0000 (18:17 -0700)]
buffer: adhere to INSPECT_MAX_BYTES
isaacs [Thu, 22 Aug 2013 00:19:41 +0000 (17:19 -0700)]
vm: Put back display_errors flag
This is an important part of the repl use-case.
TODO: The arg parsing in vm.runIn*Context() is rather wonky.
It would be good to move more of that into the Script class,
and/or an options object.
Domenic Denicola [Sat, 27 Jul 2013 04:34:12 +0000 (00:34 -0400)]
vm, core, module: re-do vm to fix known issues
As documented in #3042 and in [1], the existing vm implementation has
many problems. All of these are solved by @brianmcd's [contextify][2]
package. This commit uses contextify as a conceptual base and its code
core to overhaul the vm module and fix its many edge cases and caveats.
Functionally, this fixes #3042. In particular:
- A context is now indistinguishable from the object it is based on
(the "sandbox"). A context is simply a sandbox that has been marked
by the vm module, via `vm.createContext`, with special internal
information that allows scripts to be run inside of it.
- Consequently, items added to the context from anywhere are
immediately visible to all code that can access that context, both
inside and outside the virtual machine.
This commit also smooths over the API very slightly:
- Parameter defaults are now uniformly triggered via `undefined`, per
ES6 semantics and previous discussion at [3].
- Several undocumented and problematic features have been removed, e.g.
the conflation of `vm.Script` with `vm` itself, and the fact that
`Script` instances also had all static `vm` methods. The API is now
exactly as documented (although arguably the existence of the
`vm.Script` export is not yet documented, just the `Script` class
itself).
In terms of implementation, this replaces node_script.cc with
node_contextify.cc, which is derived originally from [4] (see [5]) but
has since undergone extensive modifications and iterations to expose
the most useful C++ API and use the coding conventions and utilities of
Node core.
The bindings exposed by `process.binding('contextify')`
(node_contextify.cc) replace those formerly exposed by
`process.binding('evals')` (node_script.cc). They are:
- ContextifyScript(code, [filename]), with methods:
- runInThisContext()
- runInContext(sandbox, [timeout])
- makeContext(sandbox)
From this, the vm.js file builds the entire documented vm module API.
node.js and module.js were modified to use this new native binding, or
the vm module itself where possible. This introduces an extra line or
two into the stack traces of module compilation (and thus into most
stack traces), explaining the changed tests.
The tests were also updated slightly, with all vm-related simple tests
consolidated as test/simple/test-vm-* (some of them were formerly
test/simple/test-script-*). At the same time they switched from
`common.debug` to `console.error` and were updated to use
`assert.throws` instead of rolling their own error-testing methods.
New tests were also added, of course, demonstrating the new
capabilities and fixes.
[1]: http://nodejs.org/docs/v0.10.16/api/vm.html#vm_caveats
[2]: https://github.com/brianmcd/contextify
[3]: https://github.com/joyent/node/issues/5323#issuecomment-
20250726
[4]: https://github.com/kkoopa/contextify/blob/
bf123f3ef960f0943d1e30bda02e3163a004e964/src/contextify.cc
[5]: https://gist.github.com/domenic/6068120
Timothy J Fontaine [Wed, 21 Aug 2013 21:16:46 +0000 (14:16 -0700)]
Now working on 0.11.7
Timothy J Fontaine [Wed, 21 Aug 2013 21:16:29 +0000 (14:16 -0700)]
Merge branch 'v0.11.6-release'
Timothy J Fontaine [Wed, 21 Aug 2013 20:20:50 +0000 (13:20 -0700)]
2013.08.21, Version 0.11.6 (Unstable)
* uv: Upgrade to v0.11.8
* v8: upgrade v8 to 3.20.14.1
* build: disable SSLv2 by default (Ben Noordhuis)
* build: don't auto-destroy existing configuration (Ben Noordhuis)
* crypto: add TLS 1.1 and 1.2 to secureProtocol list (Matthias Bartelmeß)
* crypto: fix memory leak in randomBytes() error path (Ben Noordhuis)
* dgram: don't call into js when send cb is omitted (Ben Noordhuis)
* dgram: fix regression in string argument handling (Ben Noordhuis)
* domains: performance improvements (Trevor Norris)
* events: EventEmitter = require('events') (Jake Verbaten)
* http: Add write()/end() callbacks (isaacs)
* http: Consistent 'finish' event semantics (isaacs)
* http: Prefer 'binary' over 'ascii' (isaacs)
* http: Support legacy agent.addRequest API (isaacs)
* http: Write hex/base64 chunks properly (isaacs)
* http: add agent.maxFreeSockets option (isaacs)
* http: provide access to raw headers/trailers (isaacs)
* http: removed headers stay removed (James Halliday)
* http,timers: improve callback performance (Ben Noordhuis)
* net: family option in net.connect (Vsevolod Strukchinsky)
* readline: pause stdin before turning off terminal raw mode (Daniel Chatfield)
* smalloc: allow different external array types (Trevor Norris)
* smalloc: expose ExternalArraySize (Trevor Norris)
* stream: Short-circuit buffer pushes when flowing (isaacs)
* tls: handle errors on socket before releasing it (Fedor Indutny)
* util: fix isPrimitive check (Trevor Norris)
* util: isObject should always return boolean (Trevor Norris)
Timothy J Fontaine [Wed, 21 Aug 2013 18:15:21 +0000 (11:15 -0700)]
uv: Upgrade to v0.11.8
Timothy J Fontaine [Wed, 21 Aug 2013 17:51:42 +0000 (10:51 -0700)]
test: net-GH-5504 child env needs NODE_COMMON_PORT
isaacs [Wed, 21 Aug 2013 16:40:10 +0000 (09:40 -0700)]
Merge remote-tracking branch 'ry/v0.10'
Conflicts:
lib/tls.js
Fedor Indutny [Wed, 21 Aug 2013 08:33:09 +0000 (12:33 +0400)]
test: fix test failure on linux after edd2fcc
Ben Noordhuis [Wed, 21 Aug 2013 01:33:20 +0000 (03:33 +0200)]
deps: upgrade http_parser to 303c4e4
Upgrade to joyent/http-parser@303c4e4. Changes:
* Do not accept PUN/GEM methods as PUT/GET.
* Further request method check strengthening.
Fedor Indutny [Wed, 21 Aug 2013 11:58:33 +0000 (15:58 +0400)]
tls: fix assertion when ssl is destroyed at read
`maybeInitFinished()` can emit the 'secure' event which
in turn destroys the connection in case of authentication
failure and sets `this.pair.ssl` to `null`.
If such condition appeared after non-empty read - loop will continue
and `clearOut` will be called on `null` object instead of
`crypto::Connection` instance. Resulting in the following assertion:
ERROR: Error: Hostname/IP doesn't match certificate's altnames
Assertion failed: handle->InternalFieldCount() > 0
fix #5756
Trevor Norris [Tue, 20 Aug 2013 17:55:42 +0000 (10:55 -0700)]
smalloc: consistent-ify syntax
Small syntax fixes of variable renaming and argument alignment.
Trevor Norris [Tue, 20 Aug 2013 17:30:40 +0000 (10:30 -0700)]
smalloc: length is byte size, not array length
The C++ API has been changed so the passed length is the byte size of
the data, not the length of the array.
This was done so users need to explicitly define how much memory they
want allocated.
Trevor Norris [Tue, 20 Aug 2013 17:12:29 +0000 (10:12 -0700)]
smalloc: expose ExternalArraySize
Useful to correctly determine the byte size of the external memory that
needs to be allocated for an external array.
Trevor Norris [Tue, 20 Aug 2013 18:05:36 +0000 (11:05 -0700)]
util: isObject should always return boolean
Fix small bug where isObject would return the original object instead of
true.
Vsevolod Strukchinsky [Tue, 20 Aug 2013 12:31:40 +0000 (18:31 +0600)]
net: family option in net.connect
`dns.lookup` defaults to selecting IPv4 record even if IPv6 is available
for the desired zone. Generally, this approach works, but if IPv4
address is unavailable - there'll be no other way to opt-out and connect using
IPv6 address than calling `dns.lookup` and passing it to `.connect()`
directly.
This commit adds `family` option to `net.connect` method to figure out
this issue.
Gil Pedersen [Tue, 20 Aug 2013 13:53:54 +0000 (15:53 +0200)]
fs: use correct self reference for autoClose test
isaacs [Tue, 20 Aug 2013 00:55:58 +0000 (17:55 -0700)]
doc: Minor typos in dgram doc
a/an usage. Thanks @KenanSulayman
isaacs [Tue, 20 Aug 2013 00:43:38 +0000 (17:43 -0700)]
test: Remove unnecessary assertion
It only fails once in about 1000 times, but that's too many.
It's timing dependent, and the main behavior is covered by the other
assertions in the test anyway.
Raynos [Mon, 13 May 2013 19:04:06 +0000 (13:04 -0600)]
events: have events module exports EventEmitter
This change is 100% backwards compatible.
This change will make using `EventEmitter` slightly simpler / nicer and
adheres to the best practice set forth by substack.
```js
var EventEmitter = require("events")
var emitter = new EventEmitter()
```
The only difference is that we now have to set `EventEmitter` as a
property of `EventEmitter` for backwards compatibility like we do with
[`Stream`][1]
We have also set the `usingDomains` property on the `EventEmitter`
constructor itself because that aligns with it's current usage of
`require("events").usingDomains = true`
There are other internals that would benefit from this change as well
like `StringDecoder`
Matthew Aynalem [Mon, 12 Aug 2013 22:01:05 +0000 (15:01 -0700)]
fixes #6031 spelling errors
explictly => explicitly
accesss => access
througput => throughput
epxression => expression
communiction => communication
becuase => because
repersent => represent
condonitions => conditions
decompresion => decompression
intentially => intentionally
eventes => events
listning => listening
resicved => received
becuase => because
fundimental => fundamental
colapse => collapse
privlages => privileges
sufficently => sufficiently
hapepns => happens
expliclitly => explicitly
thier => their
shold => should
Duan Yao [Tue, 4 Dec 2012 10:12:10 +0000 (18:12 +0800)]
doc: Add callback parameter to dgram socket.bind()
Also, describe more details of bind().
ChrisWren [Sun, 11 Aug 2013 19:30:03 +0000 (12:30 -0700)]
doc: fixed syntax error in stream.Transform
James Halliday [Mon, 10 Sep 2012 02:04:37 +0000 (19:04 -0700)]
http: removed headers stay removed
This allows automatically-inserted headers to be removed permanently by
calling OutgoingMessage.removeHeader() on them, as if they were normal
headers.
Edward Hutchins [Thu, 23 May 2013 01:04:36 +0000 (18:04 -0700)]
Added documentation for process.execArgv
Eivind Uggedal [Thu, 4 Jul 2013 16:52:14 +0000 (18:52 +0200)]
doc: add missing word in Transform stream intro
isaacs [Mon, 19 Aug 2013 21:15:03 +0000 (14:15 -0700)]
Merge remote-tracking branch 'ry/v0.10'
Trevor Norris [Mon, 19 Aug 2013 18:15:16 +0000 (11:15 -0700)]
buffer: lint
This and b80d11d are my fault. An unrelated test was failing, which
prevents {js,cpp}lint from running automatically.
Fedor Indutny [Mon, 19 Aug 2013 16:41:24 +0000 (20:41 +0400)]
buffer: lint
Fedor Indutny [Mon, 19 Aug 2013 16:34:34 +0000 (20:34 +0400)]
crypto: don't touch ssl_ in Connection
`ssl_` is a property of SSLWrap class, don't touch it, and definitely
don't zero it in constructor.
isaacs [Mon, 19 Aug 2013 14:59:39 +0000 (07:59 -0700)]
stream: Throw on 'error' if listeners removed
In this situation:
writable.on('error', handler);
readable.pipe(writable);
writable.removeListener('error', handler);
writable.emit('error', new Error('boom'));
there is actually no error handler, but it doesn't throw, because of the
fix for stream.once('error', handler), in 23d92ec.
Note that simply reverting that change is not valid either, because
otherwise this will emit twice, being handled the first time, and then
throwing the second:
writable.once('error', handler);
readable.pipe(writable);
writable.emit('error', new Error('boom'));
Fix this with a horrible hack to make the stream pipe onerror handler
added before any other userland handlers, so that our handler is not
affected by adding or removing any userland handlers.
Closes #6007.
Fedor Indutny [Thu, 15 Aug 2013 15:28:26 +0000 (19:28 +0400)]
tls, crypto: deduplicate code
Commit 03e008d introduced src/tls_wrap.cc and src/tls_wrap.h but
said files copied on the order of 1 kLoC from src/node_crypto.cc
and src/node_crypto.h. This commit undoes some of the duplication.
Fixes #6024.
Ben Noordhuis [Mon, 19 Aug 2013 14:39:04 +0000 (16:39 +0200)]
src: move includes inside include guard
Having the includes in src/node_buffer.h outside of the include guard
is not really harmful but it's inconsistent with other header files.
isaacs [Sat, 17 Aug 2013 20:57:41 +0000 (13:57 -0700)]
Merge remote-tracking branch 'ry/v0.10'
Conflicts:
AUTHORS
ChangeLog
lib/dgram.js
lib/http.js
src/node_crypto.cc
src/node_version.h
Ben Noordhuis [Fri, 9 Aug 2013 00:33:40 +0000 (02:33 +0200)]
dgram: fix assertion on bad send() arguments
Add range checks for the offset, length and port arguments to
dgram.Socket#send(). Fixes the following assertion:
node: ../../src/udp_wrap.cc:264: static v8::Handle<v8::Value>
node::UDPWrap::DoSend(const v8::Arguments&, int): Assertion
`offset < Buffer::Length(buffer_obj)' failed.
And:
node: ../../src/udp_wrap.cc:265: static v8::Handle<v8::Value>
node::UDPWrap::DoSend(const v8::Arguments&, int): Assertion
`length <= Buffer::Length(buffer_obj) - offset' failed.
Interestingly enough, a negative port number was accepted until now but
silently ignored. (In other words, it would send the datagram to a
random port.)
This commit exposed a bug in the simple/test-dgram-close test which
has also been fixed.
This is a back-port of commit 41ec6d0 from the master branch.
Fixes #6025.
Daniel Chatfield [Tue, 30 Jul 2013 13:43:31 +0000 (14:43 +0100)]
readline: pause stdin before turning off terminal raw mode
On windows, libuv will immediately make a `ReadConsole` call (in the
thread pool) when a 'flowing' `uv_tty_t` handle is switched to
line-buffered mode. That causes an immediate issue for some users,
since libuv can't cancel the `ReadConsole` operation on Windows 8 /
Server 2012 and up if the program switches back to raw mode later.
But even if this will be fixed in libuv at some point, it's better to
avoid the overhead of starting work in the thread pool and immediately
cancelling it afther that.
See also f34f1e3, where the same change is made for the opposite
flow, e.g. move `resume()` after `_setRawMode(true)`.
Fixes #5927
This is a backport of dfb0461 (see #5930) to the v0.10 branch.
Daniel Chatfield [Tue, 30 Jul 2013 13:43:31 +0000 (14:43 +0100)]
readline: pause stdin before turning off terminal raw mode
On windows, libuv will immediately make a `ReadConsole` call (in the
thread pool) when a 'flowing' `uv_tty_t` handle is switched to
line-buffered mode. That causes an immediate issue for some users,
since libuv can't cancel the `ReadConsole` operation on Windows 8 /
Server 2012 and up if the program switches back to raw mode later.
But even if this will be fixed in libuv at some point, it's better to
avoid the overhead of starting work in the thread pool and immediately
cancelling it afther that.
See also f34f1e3, where the same change is made for the opposite
flow, e.g. move `resume()` after `_setRawMode(true)`.
Fixes #5927
Closes #5930
isaacs [Fri, 16 Aug 2013 19:47:54 +0000 (12:47 -0700)]
blog: v0.10.16
isaacs [Fri, 16 Aug 2013 19:47:29 +0000 (12:47 -0700)]
Now working on v0.10.17
isaacs [Fri, 16 Aug 2013 19:46:56 +0000 (12:46 -0700)]
Merge branch 'v0.10.16-release' into v0.10
Trevor Norris [Fri, 16 Aug 2013 18:32:56 +0000 (11:32 -0700)]
buffer: don't call ByteLength for simple encodings
For several encodings the byte length is simple arithmetic. Don't call
into C++ in those cases.
isaacs [Fri, 16 Aug 2013 15:31:10 +0000 (08:31 -0700)]
2013.08.16, Version 0.10.16 (Stable)
* v8: back-port fix for CVE-2013-2882
* npm: Upgrade to 1.3.8
* crypto: fix assert() on malformed hex input (Ben Noordhuis)
* crypto: fix memory leak in randomBytes() error path (Ben Noordhuis)
* events: fix memory leak, don't leak event names (Ben Noordhuis)
* http: Handle hex/base64 encodings properly (isaacs)
* http: improve chunked res.write(buf) performance (Ben Noordhuis)
* stream: Fix double pipe error emit (Eran Hammer)
isaacs [Fri, 16 Aug 2013 15:19:31 +0000 (08:19 -0700)]
npm: Upgrade to 1.3.8
Ben Noordhuis [Fri, 16 Aug 2013 14:49:00 +0000 (16:49 +0200)]
crypto: fix memory leak in randomBytes() error path
This is the conceptual back-port of commit ec54873 from the master
branch.
Ben Noordhuis [Fri, 16 Aug 2013 14:42:50 +0000 (16:42 +0200)]
crypto: fix memory leak in randomBytes() error path
Ben Noordhuis [Fri, 16 Aug 2013 14:36:21 +0000 (16:36 +0200)]
crypto: don't mix new[] and free()
RandomBytes() allocated memory with new[] which was then handed off to
Buffer::Use() which eventually releases it again with free().
Mixing the two is technically a violation of the spec and besides, it's
generally frowned upon.
isaacs [Fri, 16 Aug 2013 00:39:28 +0000 (17:39 -0700)]
test: Remove hard-coded port
Brian White [Thu, 15 Aug 2013 21:56:25 +0000 (17:56 -0400)]
cluster: variable is not global
Brian White [Thu, 15 Aug 2013 21:55:35 +0000 (17:55 -0400)]
buffer: remove unused parameters
Brian White [Thu, 15 Aug 2013 21:55:05 +0000 (17:55 -0400)]
lib: remove unused variables and functions
isaacs [Thu, 15 Aug 2013 21:55:43 +0000 (14:55 -0700)]
http: Prefer 'binary' over 'ascii'
It's faster, because it doesn't have to check that each char is in the
ASCII plane.
isaacs [Thu, 15 Aug 2013 18:15:10 +0000 (11:15 -0700)]
http: Simplify IncomingMessage._dump method
isaacs [Thu, 15 Aug 2013 18:08:19 +0000 (11:08 -0700)]
http: Consistent 'finish' event semantics
In other Writable streams, the 'finish' event means that all of the data
was written, and flushed to the underlying system.
The 'prefinish' event means that end() was called, and all of the data
was processed, but not necessarily completely flushed.
This change brings the http OutgoingMessage classes more in sync with
the other Writable classes throughout Node.
Unfortunately, this change highlights an issue with http
IncomingMessages, where the _dump() method will not actually pull the
data off the wire. This is a minor issue that is typically only
relevant in test cases, and will be addressed in the next commit.
isaacs [Thu, 15 Aug 2013 15:54:49 +0000 (08:54 -0700)]
http: make OutgoingMessage._flush inline-able
isaacs [Thu, 15 Aug 2013 15:51:37 +0000 (08:51 -0700)]
http: Add write()/end() callbacks
isaacs [Thu, 15 Aug 2013 05:14:49 +0000 (22:14 -0700)]
http: Write hex/base64 chunks properly
This removes a dubious performance "optimization" where strings body
chunks were concatenated to one another (and to the headers) without any
regard for their encoding.
isaacs [Thu, 15 Aug 2013 22:01:28 +0000 (15:01 -0700)]
http: Handle hex/base64 encodings properly
This is a backport of
6d3d60aced39d59eaa5e705b7d822c227d0d3dae for
v0.10.
isaacs [Thu, 15 Aug 2013 21:12:12 +0000 (14:12 -0700)]
doc: http rawHeaders/rawTrailers
isaacs [Tue, 6 Aug 2013 01:41:17 +0000 (18:41 -0700)]
http: provide access to raw headers/trailers
The format is [key,value,key,value,...] because that seems to have the
lowest overhead.
Close #4844
isaacs [Mon, 5 Aug 2013 04:30:23 +0000 (21:30 -0700)]
doc: http keepalive, agent options
Close #5839
isaacs [Mon, 5 Aug 2013 03:54:52 +0000 (20:54 -0700)]
http: add agent.maxFreeSockets option
Ben Noordhuis [Thu, 15 Aug 2013 20:20:04 +0000 (22:20 +0200)]
test: update tests after internal api change
Commit 0aa1335 changes the way timeout events are dispatched. Update
two tests that still used the old way.
Trevor Norris [Thu, 15 Aug 2013 19:31:38 +0000 (12:31 -0700)]
node: remove duplicate infoBox checks
These checks are now done in C++ and don't need to also be checked in
JS. Also remove a couple unused variables.
Ben Noordhuis [Thu, 15 Aug 2013 17:23:36 +0000 (19:23 +0200)]
timers: dispatch ontimeout callback by array index
Achieve a minor speed-up by looking up the timeout callback on the timer
object by using an array index rather than a named property.
Gives a performance boost of about 1% on the misc/timers benchmarks.
Ben Noordhuis [Thu, 15 Aug 2013 17:22:44 +0000 (19:22 +0200)]
src: add MakeCallback() that takes an array index
Internal helper function for dispatching by array index rather than
named property.
Ben Noordhuis [Thu, 15 Aug 2013 14:41:19 +0000 (16:41 +0200)]
smalloc: don't do Has(key), then Get(key)
Don't check for the key first before retrieving it. Just fetch it and
check that it has the type we expect.
Ben Noordhuis [Thu, 15 Aug 2013 12:17:41 +0000 (14:17 +0200)]
tools: cpplint: fix NOLINT(build/include_order)
And build/include, build/include_alpha and readability/streams
probably too, though those are currently unused and therefore untested.
Ben Noordhuis [Wed, 14 Aug 2013 21:49:29 +0000 (23:49 +0200)]
zlib: replace C cast with static_cast
Seems to have escaped the Eye of Sauron^WFedor in commit 8e29ce9.
Fedor Indutny [Wed, 7 Aug 2013 12:50:36 +0000 (16:50 +0400)]
tls: handle errors on socket before releasing it
Fix sudden uncatchable ECONNRESETs, when using https server.
Ben Noordhuis [Tue, 13 Aug 2013 21:47:17 +0000 (23:47 +0200)]
http: speed up callbacks, use array indices
Use array indices rather than named properties to store callbacks on
the HTTPParser object. Speeds up the http benchmarks by a few percent.
Ben Noordhuis [Wed, 14 Aug 2013 15:45:40 +0000 (17:45 +0200)]
src: remove redundant symbol init in node_file.cc
Don't lazy-init the oncomplete symbol string in the After() function,
it has already been created at module init time.
Ben Noordhuis [Tue, 13 Aug 2013 10:07:49 +0000 (12:07 +0200)]
src: clean up FSReqWrap
Move the 'free FSReqWrap data?' logic into the class itself.
Ben Noordhuis [Tue, 13 Aug 2013 09:56:44 +0000 (11:56 +0200)]
src: move ReqWrap::data_ to FSReqWrap
FSReqWrap is the only ReqWrap child class that uses the data_ field so
move it out of ReqWrap and into FSReqWrap.
Matthias Bartelmeß [Mon, 12 Aug 2013 22:21:54 +0000 (00:21 +0200)]
crypto: add TLS 1.1 and 1.2 to secureProtocol list
Ben Noordhuis [Mon, 12 Aug 2013 21:47:04 +0000 (23:47 +0200)]
crypto: use consistent conn object unwrapping
We use `Foo:Unwrap(args.This())` everywhere else, let's use the same
idiom for Connection::Unwrap().
Ben Noordhuis [Mon, 12 Aug 2013 21:39:13 +0000 (23:39 +0200)]
crypto: use consistent variable names
Code cleanup: don't call a Connection object `p` in some places, `c` in
other places and `ss` in yet other places. Let's just call it `conn`.
This also fixes about a million style errors in one fell swoop.
Trevor Norris [Mon, 12 Aug 2013 20:41:51 +0000 (13:41 -0700)]
util: fix isPrimitive check
Previous check failed for the edge case Object.create(null). This uses
the current v8 code for the check.
Ben Noordhuis [Mon, 12 Aug 2013 20:38:39 +0000 (22:38 +0200)]
crypto: remove two unused static variables
Trevor Norris [Mon, 12 Aug 2013 19:54:49 +0000 (12:54 -0700)]
src: fix build break from generic macro name
WRAP is too generic a macro name and causes the build to fail from
conflicts. They have been prepended with NODE_.
Ben Noordhuis [Mon, 12 Aug 2013 18:34:18 +0000 (20:34 +0200)]
src: don't obj->Set(Integer::New(...), val)
Don't create an Integer when setting a numeric index on an object or an
array, use the version of v8::Object::Set() that takes an uint32_t.
Change the types of the variables from int to uint32_t and clean up
some code consistency issues while we're here.
Trevor Norris [Tue, 6 Aug 2013 00:58:29 +0000 (17:58 -0700)]
src: centralize class wrap/unwrap
While almost all cases were handled by simple WRAP/UNWRAP macros, this
extends those to cover all known occurrences.