Commit Graph

9268 Commits (0396b20ff48a7adc6e6a59e0465f72fa21bc840f)

Author SHA1 Message Date
isaacs 0396b20ff4 Merge remote-tracking branch 'ry/v0.10' 2013-10-28 14:12:00 -07:00
isaacs 4b5e6a38df npm@1.3.13 2013-10-28 14:10:47 -07:00
isaacs 3c5ea410ca vm: Copy missing properties from context
This addresses a current shortcoming of the V8 SetNamedPropertyHandler
function.

It does not provide a way to intercept Object.defineProperty(..) calls.
As a result, these properties are not copied onto the contextified
sandbox when a new global property is added via either a function
declaration or a Object.defineProperty(global, ...) call.

Note that any function declarations or Object.defineProperty() globals
that are created asynchronously (in a setTimeout, callback, etc.) will
happen AFTER the call to copy properties, and thus not be caught.

The way to properly fix this is to add some sort of a
Object::SetNamedDefinePropertyHandler() function that takes a callback,
which receives the property name and property descriptor as arguments.

Luckily, such situations are rare, and asynchronously-added globals
weren't supported by Node's VM module until 0.12 anyway.  But, this
should be fixed properly in V8, and this copy function should be removed
once there is a better way.

Fix #6416
2013-10-28 08:43:43 -07:00
Ben Noordhuis 4c0195e034 http: remove MethodToString()
The list of supported HTTP methods is available in JS land now so there
is no longer any need to pass a stringified version of the method to the
parser callback, it can look up the method name for itself.

Saves a call to v8::Eternal::Get() in the common case and a costly
v8::String::NewFromOneByte() in the uncommon case.
2013-10-28 13:57:22 +01:00
Ben Noordhuis 610022851a http: expose supported methods
Expose the list of supported HTTP methods as a property on the 'http'
module object.

Fixes #6422.
2013-10-28 13:35:34 +01:00
Phillip Alexander 977c54adb5 doc: fs: clarify fs.symlink Windows specific args 2013-10-27 21:02:19 +01:00
Ryan Graham 5ac6f4de13 doc: improve module documentation
Expands on when to use module.exports vs. exports. This is a recurring
question on mailing list and continues to confuse new devs.
2013-10-27 11:47:11 +01:00
Sam Roberts a60f67192f doc: fix missing backtick in 2e16037 2013-10-25 23:40:46 +02:00
Timothy J Fontaine 61ccaf9a97 Merge remote-tracking branch 'upstream/v0.10'
Conflicts:
	ChangeLog
	deps/uv/ChangeLog
	deps/uv/include/uv-darwin.h
	deps/uv/src/unix/fsevents.c
	deps/uv/src/unix/process.c
	deps/uv/src/version.c
	doc/api/addons.markdown
	doc/api/cluster.markdown
	doc/api/http.markdown
	lib/http.js
	lib/tls.js
	src/node_crypto.cc
	src/node_http_parser.cc
	src/node_version.h
	src/pipe_wrap.cc
	src/v8abbr.h
	src/v8ustack.d
	test/simple/test-http-pipeline-flood.js
2013-10-25 11:26:05 -07:00
Brian White 21265e20d3 doc: streams: document default objectMode setting 2013-10-25 10:33:22 -07:00
Maxim Bogushevich 9c6e06bed3 debugger: Fix bug in sb() with unnamed script
setBreakpoint() cause error when unnamed script is loaded
2013-10-25 13:17:35 +04:00
isaacs f6f176e108 npm@1.3.12 2013-10-24 09:22:13 -07:00
Ben Noordhuis 808a968409 build: fix test-gc weakref build rule
Make the build rule depend on the build artifact (weakref.node) itself
rather than the directory it's built in.  Depending on the directory
means that a build failure won't trigger a rebuild on the next
invocation because the directory's timestamp has been updated.

This is a back-port of commit 1189571 from the master branch that
hopefully fixes the following CI error:

    executing:  make test/gc/node_modules/weak/build/
    make: *** No rule to make target `test/gc/node_modules/weak/build/'.
    Command exited with non-zero: make test/gc/node_modules/weak/build/
    Build step 'Execute NodeJS script' marked build as failure
2013-10-24 16:31:31 +02:00
Zarko Stankovic eb291de00e doc: add nodejs.rs to the community page 2013-10-24 16:17:56 +02:00
isaacs f153d6da45 http client: pull last chunk on socket close
When the socket closes, the client's http incoming message object was
emitting an 'aborted' event if it had not yet been ended.

However, it's possible, when a response is being repeatedly paused and
resumed (eg, if piped to a slow FS write stream), that there will be a
final chunk remaining in the js-land buffer when the socket is torn
down.

When that happens, the socketCloseListener function detects that we have
not yet reached the end of the response message data, and treats this as
an abrupt abort, immediately (and forcibly) ending the incoming message
data stream, and discarding that final chunk of data.

The result is that, for example, npm will have problems because tarballs
are missing a few bytes off the end, every time.

Closes GH-6402
2013-10-23 13:39:05 -07:00
Ben Noordhuis 0079e575e0 test: fix up weakref.cc after v8 api change 2013-10-23 09:17:32 -07:00
Ben Noordhuis 1189571744 build: fix test-gc weakref build rule
Make the build rule depend on the build artifact (weakref.node) itself
rather than the directory it's built in.  Depending on the directory
means that a build failure won't trigger a rebuild on the next
invocation because the directory's timestamp has been updated.
2013-10-23 09:17:32 -07:00
Ben Noordhuis ef4a35bca5 src: update after v8 api changes 2013-10-23 09:17:31 -07:00
Timothy J Fontaine a53c763c16 v8: upgrade 3.21.18.3 2013-10-23 09:17:31 -07:00
Ben Noordhuis 91a0e52c03 src: IsInt64() should return bool, not int 2013-10-23 13:26:25 +02:00
isaacs 97813ae58d blog: HTTP server DoS vulnerability details
CVE-2013-4450
2013-10-22 10:56:03 -07:00
Timothy J Fontaine 028e524bce blog: Post for v0.10.21 2013-10-18 15:46:02 -07:00
Timothy J Fontaine 2649ae8395 blog: Post for v0.8.26 2013-10-18 15:43:55 -07:00
Timothy J Fontaine 85b2aaea3d Now working on 0.10.22 2013-10-18 15:40:32 -07:00
Timothy J Fontaine 7940833773 Merge branch 'v0.10.21-release' into v0.10 2013-10-18 15:39:56 -07:00
Timothy J Fontaine e2da042844 2013.10.18, Version 0.10.21 (Stable)
* uv: Upgrade to v0.10.18

* crypto: clear errors from verify failure (Timothy J Fontaine)

* dtrace: interpret two byte strings (Dave Pacheco)

* fs: fix fs.truncate() file content zeroing bug (Ben Noordhuis)

* http: provide backpressure for pipeline flood (isaacs)

* tls: fix premature connection termination (Ben Noordhuis)
2013-10-18 14:26:27 -07:00
Timothy J Fontaine 5e41c022af crypto: clear errors from verify failure
OpenSSL will push errors onto the stack when a verify fails, which can
disrupt TLS and other routines if we don't clear the error stack

Fixes #6304
2013-10-18 14:14:21 -07:00
Timothy J Fontaine 8fc48bcf4c uv: Upgrade to v0.10.18 2013-10-18 13:52:15 -07:00
Patrik Stutz 54910044b3 http: add statusMessage
Now the status message can be set via req.statusMessage = 'msg';
2013-10-16 18:34:52 -07:00
isaacs b97c28f59e http: provide backpressure for pipeline flood
If a client sends a lot more pipelined requests than we can handle, then
we need to provide backpressure so that the client knows to back off.
Do this by pausing both the stream and the parser itself when the
responses are not being read by the downstream client.

Backport of 085dd30
2013-10-16 17:12:34 -07:00
Timothy J Fontaine f051b8919f http_parser: expose pause/resume method for parser 2013-10-16 17:12:34 -07:00
Sam Roberts 2e16037201 doc: cluster documentation cleanup and corrections
- fixed some incomprehensible wording ("event assigned to..."?)
- removed undocumented and unnecessary process properties from example
- corrected the docs on the default for the exec setting
- described when workers are removed from cluster.workers
- described addressType, which was documented as existing, but not what
  values it might have
- spell out more clearly the limitations of setupMaster
- describe disconnect in sufficient detail that why a child does or does
  not exit can be understood
- clarify which cluster functions and events are available on process or
  just on the worker, as well as which are not available in children,
- don't describe events as the same, when they have receive different
  arguments
- fix misleading disconnect example: since disconnect already calls
  close on all servers, doing it again in the example is a no-op, not
  the "force close" it was claimed to be
- document the error event, not catching it will kill your node
- describe suicide better, it is important, and a bit unintuitive
  (process.exit() is not suicide?)
- use worker consistently throughout, instead of child.
2013-10-16 15:10:13 -07:00
Sam Roberts ed186c971c doc: child_process corrections and cleanups
- Make explicit that .disconnected is set before the disconnect event,
  and it is not allowed to send messages after calling .disconnect(),
  even while waiting for a delayed disconect event.
- Remove obsolete claim that explicit exit is required
- Describe silent: in the options for fork()
- Describe .connected as the property it is, not just as an aside in
  the disconnect() method
2013-10-16 15:10:13 -07:00
Fedor Indutny 2bc30f239b cpplint: disallow if one-liners 2013-10-17 00:34:19 +04:00
Fedor Indutny 7063c59b97 cpplint: disallow comma-first in C++ 2013-10-17 00:34:18 +04:00
Ben Noordhuis a2d1cbef6b dns: set hostname property on error object
Make debugging and logging easier: when a DNS lookup for a hostname
fails, set the hostname as a property on the error object.

Fixes #5393.
2013-10-16 21:56:16 +02:00
Ben Noordhuis ceb8740a63 dns: rename domain to hostname
A follow-up commit will save the domain name on the request object but
we can't call that property 'domain' because that gets intercepted by
src/node.cc and lib/domain.js to implement the node.js feature of the
same name.

To avoid confusion, rename all variables called 'domain' to 'hostname'.
2013-10-16 21:56:16 +02:00
Ben Noordhuis 4234bcce48 debugger: fix SIGUSR1 bootstrap race condition
Before this commit, the SIGUSR1 signal handler wasn't installed until
late in the bootstrapping process and we were prone to miss signals
sent by other processes.

This commit installs an early-boot signal handler that merely records
the fact that we received a signal.  Once the debugger infrastructure
is in place, the signal is re-raised, kickstarting the debugger.

Among other things, this means that simple/test-debugger-client is
now _much_ less likely to fail.
2013-10-16 20:24:14 +02:00
Ben Noordhuis ca363cf1ae debugger: make busy loops SIGUSR1-interruptible
Commit 30e5366b ("core: Use a uv_signal for debug listener") changed
SIGUSR1 handling from a signal handler to libuv's uv_signal_*()
functionality to fix a race condition (and possible hang) in the
signal handler.

While a good change in itself, it made it impossible to interrupt
long running scripts.  When a script is stuck in a busy loop, control
never returns to the event loop, which in turn means the signal
callback - and therefore the debugger - is never invoked.

This commit changes SIGUSR1 handling back to a normal signal handler
but one that treads _very_ carefully.
2013-10-16 20:24:13 +02:00
isaacs 085dd30e93 http: provide backpressure for pipeline flood
If a client sends a lot more pipelined requests than we can handle, then
we need to provide backpressure so that the client knows to back off.
Do this by pausing both the stream and the parser itself when the
responses are not being read by the downstream client.

Fix GH-6214
2013-10-16 11:01:33 -07:00
Timothy J Fontaine ab03745509 http_parser: expose pause/resume method for parser 2013-10-16 10:17:12 -07:00
Jason Gerfen 990141502d doc: crypto: document SPKAC additions
Document the SPKAC functionality that was added in commit 7bf46ba.
2013-10-16 09:44:46 -07:00
Jason Gerfen 7bf46ba4ce crypto: add SPKAC support
Implements new class 'Certificate' within crypto object for working
with SPKAC's (signed public key & challenge) natively.
2013-10-16 09:43:19 -07:00
Ben Noordhuis 5bc5210b92 doc: http: reword IncomingMessage 'close' event
The bit that says "before response.end() was called or able to flush"
doesn't apply to incoming streams.

Fixes #6359.
2013-10-16 12:56:13 +02:00
Ben Noordhuis 5ef03bc3ee doc: http: add cross-links for easier clicking
Make it a little easier to navigate the http module documentation by
turning class names and methods into links to the appropriate section.
2013-10-16 12:56:03 +02:00
isaacs a555992d5e Revert "doc: crypto: document SPKAC additions"
This reverts commit aa94450b31.
2013-10-15 15:59:05 -07:00
isaacs d9b4cc323f Revert "crypto: add SPKAC support"
This reverts commit 7f66e44dc1.
2013-10-15 15:58:58 -07:00
Jason Gerfen aa94450b31 doc: crypto: document SPKAC additions
Document the SPKAC functionality that was added in commit 7f66e44.
2013-10-15 21:12:47 +02:00
Ben Noordhuis 9a3a0ccc50 doc: expand os.loadavg() section
Add a short explanation of what the load average is and why it's
unavailable on Windows.

Also sneak in a fix for a typo that I introduced in commit 56c5806.
2013-10-15 10:17:23 +02:00
Ben Noordhuis 56c5806da3 doc: document os.loadavg() behavior on windows
The load average is a very UNIX-y concept.  That's why os.loadavg()
always returns zeros on Windows.  Mention that in the documentation.
2013-10-14 12:14:51 +02:00