8649 Commits

Author SHA1 Message Date
isaacs
df6ffc018e stream: unshift('') is a noop
In some cases, the http CONNECT/Upgrade API is unshifting an empty
bodyHead buffer onto the socket.

Normally, stream.unshift(chunk) does not set state.reading=false.
However, this check was not being done for the case when the chunk was
empty (either `''` or `Buffer(0)`), and as a result, it was causing the
socket to think that a read had completed, and to stop providing data.

This bug is not limited to http or web sockets, but rather would affect
any parser that unshifts data back onto the source stream without being
very careful to never unshift an empty chunk.  Since the intent of
unshift is to *not* change the state.reading property, this is a bug.

Fixes #5557
Fixes LearnBoost/socket.io#1242
2013-06-03 10:50:04 -07:00
isaacs
2900f0778a Merge remote-tracking branch 'ry/v0.10'
Conflicts:
	ChangeLog
	src/node_version.h
2013-05-31 11:52:57 -07:00
Trevor Norris
4b31a2d8da process: use Tock for nextTickQueue items
v8 plays very well with constructed objects, so we're using one in the
nextTickQueue.
2013-05-30 16:51:41 -07:00
Trevor Norris
bcb85a1d31 src: remove old comment code
Now that maxTickDepth no longer exists there's no depth index on
infoBox. Forgot to remove the comment about this.
2013-05-30 15:09:50 -07:00
Trevor Norris
b846842aff process: remove spinner
Remove the need to call start/stop the uv_idle spinner between
MakeCallbacks. The one place where the tick processor needs to be kicked
is where a user catches uncaughtException. For that we'll now use
setImmediate, which accomplishes the same task.
2013-05-30 14:51:40 -07:00
isaacs
ce54f4ae50 Now working on v0.10.10 2013-05-30 11:28:07 -07:00
isaacs
8c1a04dbf6 Merge branch 'v0.10.9-release' into v0.10 2013-05-30 11:27:50 -07:00
isaacs
878ffdbe6a 2013.05.30, Version 0.10.9 (Stable)
* npm: Upgrade to 1.2.24

* uv: Upgrade to v0.10.9

* repl: fix JSON.parse error check (Brian White)

* tls: proper .destroySoon (Fedor Indutny)

* tls: invoke write cb only after opposite read end (Fedor Indutny)

* tls: ignore .shutdown() syscall error (Fedor Indutny)
v0.10.9
2013-05-30 10:31:07 -07:00
isaacs
c86afa5d2e npm: Upgrade to 1.2.24 2013-05-30 10:19:45 -07:00
Trevor Norris
9a6c0853bc process: remove max tick check for domains
maxTickDepth checks have been removed for domains and replaced with a
flag that checks if the last callback threw. If it did then execution of
the remaining tickQueue is deferred to the spinner.

This is to prevent domains from entering a continuous loop when an error
callback also throws an error.
2013-05-30 09:33:21 -07:00
Trevor Norris
0761c90204 process: remove maxTickDepth from _tickCallback
Removes the check for maxTickDepth for non-domain callbacks. So a user
can starve I/O by setting a recursive nextTick.

The domain case is more complex and will be addressed in another commit.
2013-05-30 09:30:19 -07:00
Trevor Norris
5b636feaa8 process: relocate needSpinner calls
It's only necessary to request the spinner once tickDone has been
called, and not on every nextTick.
2013-05-30 09:29:15 -07:00
Andrew Paprocki
49e3fcd058 vm: fix race condition in watchdog cleanup
Previous code was calling uv_loop_delete() directly on a running loop,
which led to race condition aborts/segfaults within libuv.  This change
changes the watchdog thread to call uv_run() with UV_RUN_ONCE so that
the call exits after either the timer times out or uv_async_send() is
called from the main thread in Watchdog::Destroy().  The timer/async
handles are then closed and uv_run() with UV_RUN_DEFAULT is called so
that libuv has a chance to cleanup before the thread exits.  The main
thread meanwhile calls uv_thread_join() and then uv_loop_delete() to
complete the cleanup.
2013-05-30 15:57:25 +02:00
Kiyoshi Nomo
36e90da6df doc: remove bufferSize option
`bufferSize` option has been removed in b0f6789.
2013-05-30 15:10:03 +02:00
Ryunosuke SATO
7ce5a31061 events: define properties on prototype
Speeds up EventEmitter object construction by about 15-20%.
2013-05-30 14:50:14 +02:00
Brian White
774b28fde7 repl: fix JSON.parse error check
Before this, entering something like:

> JSON.parse('066');

resulted in the "..." prompt instead of displaying the expected
"SyntaxError: Unexpected number"
2013-05-30 14:41:00 +02:00
Brian White
6af8788f3e buffer: return this in fill() for chainability 2013-05-30 14:40:09 +02:00
Fedor Indutny
9ee86b718c tls: proper .destroySoon
1. Emit `sslOutEnd` only when `_internallyPendingBytes() === 0`.
2. Read before checking `._halfRead`, otherwise we'll see only previous
   value, and will invoke `._write` callback improperly.
3. Wait for both `end` and `finish` events in `.destroySoon`.
4. Unpipe encrypted stream from socket to prevent write after destroy.
2013-05-30 13:50:13 +04:00
Bert Belder
6b654c0b13 uv: upgrade to v0.11.4 2013-05-30 01:09:54 +02:00
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)
v0.10.8
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