Commit Graph

8805 Commits (254b711155996e379a41a569a38dd98dbd7a6e47)

Author SHA1 Message Date
Nathan Zadoks a40133d10c http: remove bodyHead from 'upgrade' events
Streams2 makes this unnecessary.
An empty buffer is provided for compatibility.
2013-05-24 14:34:32 -07:00
isaacs 9c7078cea2 Remove .travis.yml file.
This leads people to dump their fork build info into the IRC channel,
which is noisy and unhelpful.
2013-05-24 08:57:30 -07:00
Timothy J Fontaine 007e63bb13 buffer: special case empty string writes
Prior to 119354f we specifically handled passing a zero length string
to write on a buffer, restore that functionality.
2013-05-23 16:32:04 -07:00
isaacs a2f93cf77a http: Return true on empty writes, not false
Otherwise, writing an empty string causes the whole program to grind to
a halt when piping data into http messages.

This wasn't as much of a problem (though it WAS a bug) in 0.8 and
before, because our hyperactive 'drain' behavior would mean that some
*previous* write() would probably have a pending drain event, and cause
things to start moving again.
2013-05-23 15:21:17 -07:00
Timothy J Fontaine e2385839d7 v8: re-apply floating patches 2013-05-23 14:00:20 -07:00
Timothy J Fontaine dbe142c4ed v8: fix GetLocalizedMessage usage
As is the backport of the abort on uncaught exception wouldn't compile
because we it was passing in `this` when it was unnecessary.
2013-05-23 14:00:19 -07:00
Timothy J Fontaine 279361b277 v8: update to 3.14.5.9 2013-05-23 13:39:12 -07:00
Timothy J Fontaine 17e696c312 systemtap: add tapset for node user probes
This makes systemtap tracing prettier, you can do things like `stap -e
'probe node_http_server_request { println(probestr); }'`
2013-05-22 20:19:31 -07:00
Timothy J Fontaine 23509eb9e8 dtrace: unify dtrace and systemtap interfaces 2013-05-22 20:19:31 -07:00
Timothy J Fontaine f8193ab3c4 timers: use uv_now instead of Date.now
This saves a few calls to gettimeofday which can be expensive, and
potentially subject to clock drift. Instead use the loop time which
uses hrtime internally.

fixes #5497
2013-05-22 20:13:14 -07:00
Ben Noordhuis fda2b319dc http: save roundtrips, convert buffers to strings
This commit adds an optimization to the HTTP client that makes it
possible to:

* Pack the headers and the first chunk of the request body into a
  single write().

* Pack the chunk header and the chunk itself into a single write().

Because only one write() system call is issued instead of several,
the chances of data ending up in a single TCP packet are phenomenally
higher: the benchmark with `type=buf size=32` jumps from 50 req/s to
7,500 req/s, a 150-fold increase.

This commit removes the check from e4b716ef that pushes binary encoded
strings into the slow path. The commit log mentions that:

    We were assuming that any string can be concatenated safely to
    CRLF.  However, for hex, base64, or binary encoded writes, this
    is not the case, and results in sending the incorrect response.

For hex and base64 strings that's certainly true but binary strings
are 'das Ding an sich': string.length is the same before and after
decoding.

Fixes #5528.
2013-05-23 02:13:26 +02:00
Trevor Norris f58eb8f5db src: remove unused comment
Now that Context::New(Isolate*) returns Local, the removed comment is
no longer applicable that there is a Persistent which will need to be
disposed.
2013-05-22 16:09:06 -07:00
Trevor Norris 2868bf94b6 src: upgrade to new v8 api
Small change that Context::New requires an isolate and returns Local
instead of Persistent.
2013-05-22 14:12:25 -07:00
Ben Noordhuis e761ac2306 v8: reapply floating patches 2013-05-22 13:14:43 -07:00
Trevor Norris 506fc4de1e v8: upgrade to v3.19.3 2013-05-22 13:13:11 -07:00
isaacs 52adc0d963 test: Fix test-deprecation-flags
Test typos missed in util deprecation commit
2013-05-22 11:46:52 -07:00
Ben Noordhuis 89dcf22526 doc: the build requires gcc 4.2 or newer 2013-05-22 13:47:29 +02:00
Nathan Rajlich 99b737bd60 configure: respect the --dest-os flag consistently
Consider a user on his Mac, who wants to cross-compile for his Linux ARM device:

    ./configure --dest-cpu=arm --dest-os=linux

Before this patch, for example, DTrace probes would incorrectly attempt to be
enabled because the configure script is running on a MacOS machine, even though
we're trying to compile a binary for `linux`.

With this patch, the `--dest-os` flag is respected throughout the configure
script, thus leaving DTrace probes disabled in this cross-compiling scenario.
2013-05-21 18:38:11 -07:00
Timothy J Fontaine a846d9388c net: use timers._unrefActive for internal timeouts 2013-05-21 16:40:31 -07:00
Timothy J Fontaine f46ad012bc timers: internal unref'd timer for api timeouts
When an internal api needs a timeout, they should use
timers._unrefActive since that won't hold the loop open. This solves
the problem where you might have unref'd the socket handle but the
timeout for the socket was still active.
2013-05-21 16:40:30 -07:00
isaacs 896b2aa707 util: Add debuglog, deprecate console lookalikes 2013-05-21 16:39:50 -07:00
Trevor Norris 2cad7a69ce buffer: throw when writing beyond buffer
Previously one could write anywhere in a buffer pool if they accidently
got their offset wrong. Mainly because the cc level checks only test
against the parent slow buffer and not against the js object properties.
So now we check to make sure values won't go beyond bounds without
letting the dev know.
2013-05-20 15:23:23 -07:00
isaacs 0fefcc1690 Merge remote-tracking branch ry/v0.10 into master
Conflicts:
	AUTHORS
	ChangeLog
	src/node_crypto.cc
	src/node_version.h
2013-05-20 14:43:14 -07:00
isaacs 3a2b5030ae crypto: Clear error after DiffieHellman key errors
Fixes #5499
2013-05-20 14:27:32 -07:00
Trevor Norris d5d5170c35 string_bytes: strip padding from base64 strings
Because of variations in different base64 implementation, it's been
decided to strip all padding from the end of a base64 string and
calculate its size from that.
2013-05-20 13:40:58 -07:00
Ben Noordhuis d820b64412 tls: add localAddress and localPort properties
Add localAddress and localPort properties to tls.CleartextStream.
Like remoteAddress and localPort, delegate to the backing net.Socket
object.

Refs #5502.
2013-05-20 15:18:50 +02:00
isaacs f57ff787aa src: Remove superfluous static_cast 2013-05-17 16:58:05 -07:00
Robert Kowalski 812356049d module: use path.sep instead of a custom solution
Instead of using a custom solution we can use path.sep in
Module._nodeModulePaths
2013-05-18 01:43:07 +02:00
isaacs 77de207089 blog: Release 0.10.7 2013-05-17 14:38:02 -07:00
isaacs bae6d089a4 Now working on 0.10.8 2013-05-17 14:37:44 -07:00
isaacs cc7ec075e9 Merge branch 'v0.10.7-release' into v0.10 2013-05-17 14:37:28 -07:00
isaacs 61c9f78c63 Merge remote-tracking branch 'ry/v0.10' into master
Conflicts:
	AUTHORS
	ChangeLog
	deps/uv/ChangeLog
	deps/uv/config-unix.mk
	deps/uv/src/unix/stream.c
	deps/uv/src/version.c
	deps/uv/uv.gyp
	src/node.cc
	src/node_buffer.cc
	src/node_crypto.cc
	src/node_version.h
	src/stream_wrap.cc
	src/stream_wrap.h
2013-05-17 14:04:54 -07:00
isaacs d2fdae197a 2013.05.17, Version 0.10.7 (Stable)
* uv: upgrade to v0.10.7

* npm: Upgrade to 1.2.21

* crypto: Don't ignore verify encoding argument (isaacs)

* buffer, crypto: fix default encoding regression (Ben Noordhuis)

* timers: fix setInterval() assert (Ben Noordhuis)
2013-05-17 13:59:10 -07:00
Brandon Frohs 49300a4fa6 doc: Fix link to open issues on GitHub. 2013-05-17 13:56:24 -07:00
isaacs 199fa9f8dd crypto: Don't ignore verify encoding argument 2013-05-17 13:55:29 -07:00
Trevor Norris 7998843807 fs_event: use cached Persistent syms instead
Instead of String::New every time, use a Persistent sym. This can be
accomplished in two ways:

1) Local<String> str = *persistent_str_sym;

2) Handle<String> str = persistent_str_sym;

I've chosen to use the latter method for simplicity's sake.

Other small changes include creating syms on Initialize and removing
unnecessary Local casting on return values.
2013-05-16 16:06:01 -07:00
Trevor Norris 999ee45d36 src: add node_isolates
Few primitives weren't being passed node_isolate. Adding them for
consistency.
2013-05-16 15:58:33 -07:00
Ben Noordhuis f59ab10a64 buffer, crypto: fix default encoding regression
The default encoding is 'buffer'. When the input is a string, treat it
as 'binary'. Fixes the following assertion:

  node: ../src/string_bytes.cc:309: static size_t
  node::StringBytes::StorageSize(v8::Handle<v8::Value>, node::encoding):
  Assertion `0 && "buffer encoding specified but string provided"'
  failed.

Introduced in 64fc34b2.

Fixes #5482.
2013-05-16 17:25:24 +02:00
Ryuichi Okumura 4cd643ee2d doc: fix missing Class in header 2013-05-16 16:56:56 +02:00
Ryuichi Okumura b06c82fd88 doc: fix the link to Stream document 2013-05-16 16:56:41 +02:00
Trevor Norris 88333f7ace http: don't slice unless necessary
The incoming Buffer was being sliced just to possibly not be used.
Instead place the .slice inside the conditional to not be created unless
necessary.
2013-05-15 15:10:56 -07:00
Timothy J Fontaine f0d80d7db0 dtrace: enable uv's probes if enabled 2013-05-15 15:07:53 -07:00
Ben Noordhuis 22533c035d timers: fix setInterval() assert
Test case:

  var t = setInterval(function() {}, 1);
  process.nextTick(t.unref);

Output:

  Assertion failed: (args.Holder()->InternalFieldCount() > 0),
  function Unref, file ../src/handle_wrap.cc, line 78.

setInterval() returns a binding layer object. Make it stop doing that,
wrap the raw process.binding('timer_wrap').Timer object in a Timeout
object.

Fixes #4261.
2013-05-16 00:02:54 +02:00
Robert Kowalski 04ce80760e module: use path.sep instead of custom solution
Instead of using a custom solution for path delimiters we can use
path.sep in Module._initPaths
2013-05-15 23:57:58 +02:00
Ben Noordhuis 7124387b34 http: don't escape request path, reject bad chars
Commit 38149bb changes http.get() and http.request() to escape unsafe
characters. However, that creates an incompatibility with v0.10 that
is difficult to work around: if you escape the path manually, then in
v0.11 it gets escaped twice. Change lib/http.js so it no longer tries
to fix up bad request paths, simply reject them with an exception.

The actual check is rather basic right now. The full check for illegal
characters is difficult to implement efficiently because it requires a
few characters of lookahead. That's why it currently only checks for
spaces because those are guaranteed to create an invalid request.

Fixes #5474.
2013-05-15 22:53:29 +02:00
Ben Noordhuis b3d1e504f4 net: emit dns 'lookup' event before connect
net.connect() and net.createConnection() now emit a 'lookup' event
after resolving the hostname but before connecting.

Fixes #5418.
2013-05-15 22:53:29 +02:00
Ben Noordhuis 6902f6536c deps: fix up header files in cares.gyp
Please msbuild, update the header list.
2013-05-15 22:47:42 +02:00
Ben Noordhuis 3afa5e6b71 deps: reapply c-ares floating patch 2013-05-15 21:25:11 +02:00
Ryan Graham 1deeab29f2 doc: improve exports/module.exports consistency
While they reference the same object, they are only interchangeable
for updates, not assignment.
2013-05-15 21:06:32 +02:00
Ryan Graham 93391ae9cb doc: clarify exports and module.exports
When exporting a single function you must use `module.exports` instead
of the `exports` convenience reference.
2013-05-15 21:05:57 +02:00