Commit Graph

8580 Commits (c188a7510317bfdaa19e87c6870c5ee7d965a6b9)

Author SHA1 Message Date
Ben Noordhuis c188a75103 buffer: guard against integer overflow 2013-05-30 00:13:05 +02:00
Ben Noordhuis 36ebff0470 buffer: simplify ReadFloatGeneric offset checks 2013-05-30 00:13:04 +02:00
Ben Noordhuis ef0926ce42 os: use IsBigEndian() in GetEndianness() function 2013-05-30 00:13:04 +02:00
Ben Noordhuis d02f228263 buffer: guard against pointer aliasing issues 2013-05-30 00:12:57 +02:00
Ben Noordhuis 7890a69e4d src: add endianness helper functions 2013-05-30 00:12:57 +02:00
Ben Noordhuis 448adaa456 src: simplify HandleWrap initialization 2013-05-30 00:12:49 +02:00
Ben Noordhuis 4d68daea0f src: replace c-style casts with c++-style casts 2013-05-30 00:12:49 +02:00
Ben Noordhuis 28659aba37 Merge remote-tracking branch 'origin/v0.10'
Conflicts:
	deps/uv/ChangeLog
	deps/uv/src/unix/stream.c
	deps/uv/src/version.c
	lib/tls.js
2013-05-29 23:12:11 +02:00
Ben Noordhuis 9826b15493 doc: sending dgram handles only works on unix 2013-05-29 16:35:01 +02:00
Daniel G. Taylor 675e85813f https: Add `secureProtocol` docs
Add `secureProtocol` parameter docs to the https.request method.
2013-05-28 21:43:37 +02:00
Daniel G. Taylor 30cb9fec91 tls: Add `secureProtocol` docs
Add `secureProtocol` parameter docs to the tls.connect method.
2013-05-28 21:40:52 +02:00
isaacs f523f7041d uv: Upgrade to v0.10.9 2013-05-28 12:10:14 -07:00
Fedor Indutny 4f14221f03 tls: invoke write cb only after opposite read end
Stream's `._write()` callback should be invoked only after it's opposite
stream has finished processing incoming data, otherwise `finish` event
fires too early and connection might be closed while there's some data
to send to the client.

see #5544
2013-05-28 22:27:07 +04:00
Fedor Indutny fa170dd2b2 tls: ignore .shutdown() syscall error
Quote from SSL_shutdown man page:

  The output of SSL_get_error(3) may be misleading,
  as an erroneous SSL_ERROR_SYSCALL may be flagged even though
  no error occurred.

Also, handle all other errors to prevent assertion in `ClearError()`.
2013-05-28 20:14:44 +04:00
isaacs ba048e72b0 Merge remote-tracking branch 'ry/v0.10'
Conflicts:
	AUTHORS
	ChangeLog
	configure
	deps/uv/ChangeLog
	deps/uv/src/unix/darwin.c
	deps/uv/src/unix/stream.c
	deps/uv/src/version.c
	deps/v8/src/isolate.cc
	deps/v8/src/version.cc
	lib/http.js
	src/node_version.h
2013-05-27 14:46:52 -07:00
Rafael Henrique Moreira 28f4c15eb4 doc: add link to Brazilian Node community
Add a link to the Brazilian community portal.
2013-05-25 13:30:34 +02:00
Rafael Henrique Moreira 14b10c40ac doc: remove broken links on community page
Links to Node Manual and Node Bits both are broken, so this commit
removes them from the community page.
2013-05-25 13:30:30 +02:00
isaacs f904d614bf blog: Post for v0.10.8 2013-05-24 15:45:59 -07:00
isaacs ccb77e1c9d Now working on 0.10.9 2013-05-24 15:45:46 -07:00
isaacs 83a8943036 Merge branch 'v0.10.8-release' into v0.10 2013-05-24 15:44:04 -07:00
isaacs 30d9e9fdd9 2013.05.24, Version 0.10.8 (Stable)
* v8: update to 3.14.5.9

* uv: upgrade to 0.10.8

* npm: Upgrade to 1.2.23

* http: remove bodyHead from 'upgrade' events (Nathan Zadoks)

* http: Return true on empty writes, not false (isaacs)

* http: save roundtrips, convert buffers to strings (Ben Noordhuis)

* configure: respect the --dest-os flag consistently (Nathan Rajlich)

* buffer: throw when writing beyond buffer (Trevor Norris)

* crypto: Clear error after DiffieHellman key errors (isaacs)

* string_bytes: strip padding from base64 strings (Trevor Norris)
2013-05-24 15:06:33 -07:00
isaacs 179aa0a8f2 doc: Minor fixup in http doc re bodyHead 2013-05-24 15:06:12 -07:00
Fedor Indutny f7ff8b4454 tls: retry writing after hello parse error
When writing bad data to EncryptedStream it'll first get to the
ClientHello parser, and, only after it will refuse it, to the OpenSSL.
But ClientHello parser has limited buffer and therefore write could
return `bytes_written` < `incoming_bytes`, which is not the case when
working with OpenSSL.

After such errors ClientHello parser disables itself and will
pass-through all data to the OpenSSL. So just trying to write data one
more time will throw the rest into OpenSSL and let it handle it.
2013-05-24 15:03:48 -07:00
isaacs 074e823a81 npm: Upgrade to 1.2.23 2013-05-24 14:41:43 -07:00
isaacs 1314c4aeeb uv: upgrade to 0.10.8 2013-05-24 14:41:00 -07:00
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