Commit 523b8b00 authored by Jérémy Lal's avatar Jérémy Lal

Imported Upstream version 0.10.9~dfsg1

parent 3cfa9db4
......@@ -450,3 +450,6 @@ Benoit Vallée <github@benoitvallee.net>
Ryuichi Okumura <okuryu@okuryu.com>
Brandon Frohs <bfrohs@gmail.com>
Nathan Zadoks <nathan@nathan7.eu>
Rafael Henrique Moreira <rafadev7@gmail.com>
Daniel G. Taylor <dan@programmer-art.org>
Kiyoshi Nomo <tokyoincidents.g@gmail.com>
2013.05.24, Version 0.10.8 (Stable)
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)
2013.05.24, Version 0.10.8 (Stable), 30d9e9fdd9d4c33d3d95a129d021cd8b5b91eddb
* v8: update to 3.14.5.9
......
2013.05.25, Version 0.10.8 (Stable)
2013.05.29, Version 0.10.9 (Stable)
Changes since version 0.10.8:
* unix: fix stream refcounting buglet (Ben Noordhuis)
* unix: remove erroneous asserts (Ben Noordhuis)
* unix: add uv__is_closing() macro (Ben Noordhuis)
* unix: stop stream POLLOUT watcher on write error (Ben Noordhuis)
2013.05.25, Version 0.10.8 (Stable), 0f39be12926fe2d8766a9f025797a473003e6504
Changes since version 0.10.7:
......
......@@ -162,7 +162,12 @@ void uv__make_close_pending(uv_handle_t* handle) {
static void uv__finish_close(uv_handle_t* handle) {
assert(!uv__is_active(handle));
/* Note: while the handle is in the UV_CLOSING state now, it's still possible
* for it to be active in the sense that uv__is_active() returns true.
* A good example is when the user calls uv_shutdown(), immediately followed
* by uv_close(). The handle is considered active at this point because the
* completion of the shutdown req is still pending.
*/
assert(handle->flags & UV_CLOSING);
assert(!(handle->flags & UV_CLOSED));
handle->flags |= UV_CLOSED;
......@@ -220,7 +225,7 @@ static void uv__run_closing_handles(uv_loop_t* loop) {
int uv_is_closing(const uv_handle_t* handle) {
return handle->flags & (UV_CLOSING | UV_CLOSED);
return uv__is_closing(handle);
}
......
......@@ -429,6 +429,11 @@ void uv__stream_destroy(uv_stream_t* stream) {
}
if (stream->shutdown_req) {
/* The UV_ECANCELED error code is a lie, the shutdown(2) syscall is a
* fait accompli at this point. Maybe we should revisit this in v0.11.
* A possible reason for leaving it unchanged is that it informs the
* callee that the handle has been destroyed.
*/
uv__req_unregister(stream->loop, stream->shutdown_req);
uv__set_artificial_error(stream->loop, UV_ECANCELED);
stream->shutdown_req->cb(stream->shutdown_req, -1);
......@@ -627,8 +632,6 @@ static void uv__drain(uv_stream_t* stream) {
uv_shutdown_t* req;
assert(ngx_queue_empty(&stream->write_queue));
assert(stream->write_queue_size == 0);
uv__io_stop(stream->loop, &stream->io_watcher, UV__POLLOUT);
/* Shutdown? */
......@@ -722,10 +725,8 @@ start:
assert(uv__stream_fd(stream) >= 0);
if (ngx_queue_empty(&stream->write_queue)) {
assert(stream->write_queue_size == 0);
if (ngx_queue_empty(&stream->write_queue))
return;
}
q = ngx_queue_head(&stream->write_queue);
req = ngx_queue_data(q, uv_write_t, queue);
......@@ -797,6 +798,9 @@ start:
/* Error */
req->error = errno;
uv__write_req_finish(req);
uv__io_stop(stream->loop, &stream->io_watcher, UV__POLLOUT);
if (!uv__io_active(&stream->io_watcher, UV__POLLIN))
uv__handle_stop(stream);
return;
} else if (stream->flags & UV_STREAM_BLOCKING) {
/* If this is a blocking stream, try again. */
......@@ -1200,6 +1204,12 @@ int uv_write2(uv_write_t* req,
return uv__set_artificial_error(stream->loop, UV_EBADF);
}
/* It's legal for write_queue_size > 0 even when the write_queue is empty;
* it means there are error-state requests in the write_completed_queue that
* will touch up write_queue_size later, see also uv__write_req_finish().
* We chould check that write_queue is empty instead but that implies making
* a write() syscall when we know that the handle is in error mode.
*/
empty_queue = (stream->write_queue_size == 0);
/* Initialize the req */
......@@ -1318,9 +1328,10 @@ int uv_read_stop(uv_stream_t* stream) {
stream->shutdown_req != NULL ||
stream->connect_req != NULL);
uv__io_stop(stream->loop, &stream->io_watcher, UV__POLLIN);
uv__handle_stop(stream);
stream->flags &= ~UV_STREAM_READING;
uv__io_stop(stream->loop, &stream->io_watcher, UV__POLLIN);
if (!uv__io_active(&stream->io_watcher, UV__POLLOUT))
uv__handle_stop(stream);
#if defined(__APPLE__)
/* Notify select() thread about state change */
......
......@@ -149,6 +149,9 @@ void uv__fs_poll_close(uv_fs_poll_t* handle);
#define uv__is_active(h) \
(((h)->flags & UV__HANDLE_ACTIVE) != 0)
#define uv__is_closing(h) \
(((h)->flags & (UV_CLOSING | UV_CLOSED)) != 0)
#define uv__handle_start(h) \
do { \
assert(((h)->flags & UV__HANDLE_CLOSING) == 0); \
......
......@@ -34,7 +34,7 @@
#define UV_VERSION_MAJOR 0
#define UV_VERSION_MINOR 10
#define UV_VERSION_PATCH 8
#define UV_VERSION_PATCH 9
#define UV_VERSION_IS_RELEASE 1
......
......@@ -2,7 +2,7 @@
<html lang="en">
<head>
<meta charset="utf-8">
<title> Node.js v0.10.8 Manual &amp; Documentation</title>
<title> Node.js v0.10.9 Manual &amp; Documentation</title>
<link rel="stylesheet" href="assets/style.css">
<link rel="stylesheet" href="assets/sh.css">
<link rel="canonical" href="http://nodejs.org/api/_toc.html">
......@@ -31,7 +31,7 @@
<div id="column1" class="interior">
<header>
<h1>Node.js v0.10.8 Manual &amp; Documentation</h1>
<h1>Node.js v0.10.9 Manual &amp; Documentation</h1>
<div id="gtoc">
<p>
<a href="index.html" name="toc">Index</a> |
......@@ -105,7 +105,7 @@
<li><a href="http://twitter.com/nodejs" class="twitter">@nodejs</a></li>
</ul>
<p>Copyright <a href="http://joyent.com/">Joyent, Inc</a>, Node.js is a <a href="/trademark-policy.pdf">trademark</a> of Joyent, Inc. View <a href="https://raw.github.com/joyent/node/v0.10.8/LICENSE">license</a>.</p>
<p>Copyright <a href="http://joyent.com/">Joyent, Inc</a>, Node.js is a <a href="/trademark-policy.pdf">trademark</a> of Joyent, Inc. View <a href="https://raw.github.com/joyent/node/v0.10.9/LICENSE">license</a>.</p>
</div>
<script src="../sh_main.js"></script>
......
......@@ -2,7 +2,7 @@
<html lang="en">
<head>
<meta charset="utf-8">
<title>Addons Node.js v0.10.8 Manual &amp; Documentation</title>
<title>Addons Node.js v0.10.9 Manual &amp; Documentation</title>
<link rel="stylesheet" href="assets/style.css">
<link rel="stylesheet" href="assets/sh.css">
<link rel="canonical" href="http://nodejs.org/api/addons.html">
......@@ -31,7 +31,7 @@
<div id="column1" class="interior">
<header>
<h1>Node.js v0.10.8 Manual &amp; Documentation</h1>
<h1>Node.js v0.10.9 Manual &amp; Documentation</h1>
<div id="gtoc">
<p>
<a href="index.html" name="toc">Index</a> |
......@@ -715,7 +715,7 @@ console.log(result); // 30</code></pre>
<li><a href="http://twitter.com/nodejs" class="twitter">@nodejs</a></li>
</ul>
<p>Copyright <a href="http://joyent.com/">Joyent, Inc</a>, Node.js is a <a href="/trademark-policy.pdf">trademark</a> of Joyent, Inc. View <a href="https://raw.github.com/joyent/node/v0.10.8/LICENSE">license</a>.</p>
<p>Copyright <a href="http://joyent.com/">Joyent, Inc</a>, Node.js is a <a href="/trademark-policy.pdf">trademark</a> of Joyent, Inc. View <a href="https://raw.github.com/joyent/node/v0.10.9/LICENSE">license</a>.</p>
</div>
<script src="../sh_main.js"></script>
......
......@@ -2,7 +2,7 @@
<html lang="en">
<head>
<meta charset="utf-8">
<title>About this Documentation Node.js v0.10.8 Manual &amp; Documentation</title>
<title>About this Documentation Node.js v0.10.9 Manual &amp; Documentation</title>
<link rel="stylesheet" href="assets/style.css">
<link rel="stylesheet" href="assets/sh.css">
<link rel="canonical" href="http://nodejs.org/api/all.html">
......@@ -31,7 +31,7 @@
<div id="column1" class="interior">
<header>
<h1>Node.js v0.10.8 Manual &amp; Documentation</h1>
<h1>Node.js v0.10.9 Manual &amp; Documentation</h1>
<div id="gtoc">
<p>
<a href="index.html" name="toc">Index</a> |
......@@ -6307,6 +6307,10 @@ usually be much simpler: <code>[&#39;hello&#39;, &#39;world&#39;]</code>.)</p>
</li>
<li><p><code>servername</code>: Servername for SNI (Server Name Indication) TLS extension.</p>
</li>
<li><p><code>secureProtocol</code>: The SSL method to use, e.g. <code>SSLv3_method</code> to force
SSL version 3. The possible values depend on your installation of
OpenSSL and are defined in the constant <a href="http://www.openssl.org/docs/ssl/ssl.html#DEALING_WITH_PROTOCOL_METHODS">SSL_METHODS</a>.</p>
</li>
</ul>
<p>The <code>callback</code> parameter will be added as a listener for the
<a href="#tls_event_secureconnect">&#39;secureConnect&#39;</a> event.
......@@ -7314,7 +7318,6 @@ be found in the <a href="https://developer.mozilla.org/en/JavaScript/Reference/G
encoding: null,
fd: null,
mode: 0666,
bufferSize: 64 * 1024,
autoClose: true
}</code></pre>
<p><code>options</code> can include <code>start</code> and <code>end</code> values to read a range of bytes from
......@@ -9638,6 +9641,9 @@ details on the format.</li>
the list of supplied CAs. An <code>&#39;error&#39;</code> event is emitted if verification
fails. Verification happens at the connection level, <em>before</em> the HTTP
request is sent. Default <code>true</code>.</li>
<li><code>secureProtocol</code>: The SSL method to use, e.g. <code>SSLv3_method</code> to force
SSL version 3. The possible values depend on your installation of
OpenSSL and are defined in the constant <a href="http://www.openssl.org/docs/ssl/ssl.html#DEALING_WITH_PROTOCOL_METHODS">SSL_METHODS</a>.</li>
</ul>
<p>In order to specify these options, use a custom <code>Agent</code>.
......@@ -10910,7 +10916,7 @@ that some connections will be handled by the parent and some by the child.
</p>
<p>For <code>dgram</code> servers the workflow is exactly the same. Here you listen on
a <code>message</code> event instead of <code>connection</code> and use <code>server.bind</code> instead of
<code>server.listen</code>.
<code>server.listen</code>. (Currently only supported on UNIX platforms.)
</p>
<h4>Example: sending socket object<span><a class="mark" href="#all_example_sending_socket_object" id="all_example_sending_socket_object">#</a></span></h4>
......@@ -12692,7 +12698,7 @@ worker.on(&#39;exit&#39;, function(code, signal) {
<li><a href="http://twitter.com/nodejs" class="twitter">@nodejs</a></li>
</ul>
<p>Copyright <a href="http://joyent.com/">Joyent, Inc</a>, Node.js is a <a href="/trademark-policy.pdf">trademark</a> of Joyent, Inc. View <a href="https://raw.github.com/joyent/node/v0.10.8/LICENSE">license</a>.</p>
<p>Copyright <a href="http://joyent.com/">Joyent, Inc</a>, Node.js is a <a href="/trademark-policy.pdf">trademark</a> of Joyent, Inc. View <a href="https://raw.github.com/joyent/node/v0.10.9/LICENSE">license</a>.</p>
</div>
<script src="../sh_main.js"></script>
......
This diff is collapsed.
......@@ -2,7 +2,7 @@
<html lang="en">
<head>
<meta charset="utf-8">
<title>Assert Node.js v0.10.8 Manual &amp; Documentation</title>
<title>Assert Node.js v0.10.9 Manual &amp; Documentation</title>
<link rel="stylesheet" href="assets/style.css">
<link rel="stylesheet" href="assets/sh.css">
<link rel="canonical" href="http://nodejs.org/api/assert.html">
......@@ -31,7 +31,7 @@
<div id="column1" class="interior">
<header>
<h1>Node.js v0.10.8 Manual &amp; Documentation</h1>
<h1>Node.js v0.10.9 Manual &amp; Documentation</h1>
<div id="gtoc">
<p>
<a href="index.html" name="toc">Index</a> |
......@@ -165,7 +165,7 @@ testing the first argument, <code>error</code> in callbacks.
<li><a href="http://twitter.com/nodejs" class="twitter">@nodejs</a></li>
</ul>
<p>Copyright <a href="http://joyent.com/">Joyent, Inc</a>, Node.js is a <a href="/trademark-policy.pdf">trademark</a> of Joyent, Inc. View <a href="https://raw.github.com/joyent/node/v0.10.8/LICENSE">license</a>.</p>
<p>Copyright <a href="http://joyent.com/">Joyent, Inc</a>, Node.js is a <a href="/trademark-policy.pdf">trademark</a> of Joyent, Inc. View <a href="https://raw.github.com/joyent/node/v0.10.9/LICENSE">license</a>.</p>
</div>
<script src="../sh_main.js"></script>
......
......@@ -2,7 +2,7 @@
<html lang="en">
<head>
<meta charset="utf-8">
<title>Buffer Node.js v0.10.8 Manual &amp; Documentation</title>
<title>Buffer Node.js v0.10.9 Manual &amp; Documentation</title>
<link rel="stylesheet" href="assets/style.css">
<link rel="stylesheet" href="assets/sh.css">
<link rel="canonical" href="http://nodejs.org/api/buffer.html">
......@@ -31,7 +31,7 @@
<div id="column1" class="interior">
<header>
<h1>Node.js v0.10.8 Manual &amp; Documentation</h1>
<h1>Node.js v0.10.9 Manual &amp; Documentation</h1>
<div id="gtoc">
<p>
<a href="index.html" name="toc">Index</a> |
......@@ -892,7 +892,7 @@ then Node will allocate a SlowBuffer slab for it directly.
<li><a href="http://twitter.com/nodejs" class="twitter">@nodejs</a></li>
</ul>
<p>Copyright <a href="http://joyent.com/">Joyent, Inc</a>, Node.js is a <a href="/trademark-policy.pdf">trademark</a> of Joyent, Inc. View <a href="https://raw.github.com/joyent/node/v0.10.8/LICENSE">license</a>.</p>
<p>Copyright <a href="http://joyent.com/">Joyent, Inc</a>, Node.js is a <a href="/trademark-policy.pdf">trademark</a> of Joyent, Inc. View <a href="https://raw.github.com/joyent/node/v0.10.9/LICENSE">license</a>.</p>
</div>
<script src="../sh_main.js"></script>
......
......@@ -2,7 +2,7 @@
<html lang="en">
<head>
<meta charset="utf-8">
<title>Child Process Node.js v0.10.8 Manual &amp; Documentation</title>
<title>Child Process Node.js v0.10.9 Manual &amp; Documentation</title>
<link rel="stylesheet" href="assets/style.css">
<link rel="stylesheet" href="assets/sh.css">
<link rel="canonical" href="http://nodejs.org/api/child_process.html">
......@@ -31,7 +31,7 @@
<div id="column1" class="interior">
<header>
<h1>Node.js v0.10.8 Manual &amp; Documentation</h1>
<h1>Node.js v0.10.9 Manual &amp; Documentation</h1>
<div id="gtoc">
<p>
<a href="index.html" name="toc">Index</a> |
......@@ -328,7 +328,7 @@ that some connections will be handled by the parent and some by the child.
</p>
<p>For <code>dgram</code> servers the workflow is exactly the same. Here you listen on
a <code>message</code> event instead of <code>connection</code> and use <code>server.bind</code> instead of
<code>server.listen</code>.
<code>server.listen</code>. (Currently only supported on UNIX platforms.)
</p>
<h4>Example: sending socket object<span><a class="mark" href="#child_process_example_sending_socket_object" id="child_process_example_sending_socket_object">#</a></span></h4>
......@@ -722,7 +722,7 @@ output on this fd is expected to be line delimited JSON objects.
<li><a href="http://twitter.com/nodejs" class="twitter">@nodejs</a></li>
</ul>
<p>Copyright <a href="http://joyent.com/">Joyent, Inc</a>, Node.js is a <a href="/trademark-policy.pdf">trademark</a> of Joyent, Inc. View <a href="https://raw.github.com/joyent/node/v0.10.8/LICENSE">license</a>.</p>
<p>Copyright <a href="http://joyent.com/">Joyent, Inc</a>, Node.js is a <a href="/trademark-policy.pdf">trademark</a> of Joyent, Inc. View <a href="https://raw.github.com/joyent/node/v0.10.9/LICENSE">license</a>.</p>
</div>
<script src="../sh_main.js"></script>
......
......@@ -131,7 +131,7 @@
]
}
],
"desc": "<p>When using <code>child_process.fork()</code> you can write to the child using\n<code>child.send(message, [sendHandle])</code> and messages are received by\na <code>&#39;message&#39;</code> event on the child.\n\n</p>\n<p>For example:\n\n</p>\n<pre><code>var cp = require(&#39;child_process&#39;);\n\nvar n = cp.fork(__dirname + &#39;/sub.js&#39;);\n\nn.on(&#39;message&#39;, function(m) {\n console.log(&#39;PARENT got message:&#39;, m);\n});\n\nn.send({ hello: &#39;world&#39; });</code></pre>\n<p>And then the child script, <code>&#39;sub.js&#39;</code> might look like this:\n\n</p>\n<pre><code>process.on(&#39;message&#39;, function(m) {\n console.log(&#39;CHILD got message:&#39;, m);\n});\n\nprocess.send({ foo: &#39;bar&#39; });</code></pre>\n<p>In the child the <code>process</code> object will have a <code>send()</code> method, and <code>process</code>\nwill emit objects each time it receives a message on its channel.\n\n</p>\n<p>There is a special case when sending a <code>{cmd: &#39;NODE_foo&#39;}</code> message. All messages\ncontaining a <code>NODE_</code> prefix in its <code>cmd</code> property will not be emitted in\nthe <code>message</code> event, since they are internal messages used by node core.\nMessages containing the prefix are emitted in the <code>internalMessage</code> event, you\nshould by all means avoid using this feature, it is subject to change without notice.\n\n</p>\n<p>The <code>sendHandle</code> option to <code>child.send()</code> is for sending a TCP server or\nsocket object to another process. The child will receive the object as its\nsecond argument to the <code>message</code> event.\n\n</p>\n<p>Emits an <code>&#39;error&#39;</code> event if the message cannot be sent, for example because\nthe child process has already exited.\n\n</p>\n<h4>Example: sending server object</h4>\n<p>Here is an example of sending a server:\n\n</p>\n<pre><code>var child = require(&#39;child_process&#39;).fork(&#39;child.js&#39;);\n\n// Open up the server object and send the handle.\nvar server = require(&#39;net&#39;).createServer();\nserver.on(&#39;connection&#39;, function (socket) {\n socket.end(&#39;handled by parent&#39;);\n});\nserver.listen(1337, function() {\n child.send(&#39;server&#39;, server);\n});</code></pre>\n<p>And the child would the receive the server object as:\n\n</p>\n<pre><code>process.on(&#39;message&#39;, function(m, server) {\n if (m === &#39;server&#39;) {\n server.on(&#39;connection&#39;, function (socket) {\n socket.end(&#39;handled by child&#39;);\n });\n }\n});</code></pre>\n<p>Note that the server is now shared between the parent and child, this means\nthat some connections will be handled by the parent and some by the child.\n\n</p>\n<p>For <code>dgram</code> servers the workflow is exactly the same. Here you listen on\na <code>message</code> event instead of <code>connection</code> and use <code>server.bind</code> instead of\n<code>server.listen</code>.\n\n</p>\n<h4>Example: sending socket object</h4>\n<p>Here is an example of sending a socket. It will spawn two children and handle\nconnections with the remote address <code>74.125.127.100</code> as VIP by sending the\nsocket to a &quot;special&quot; child process. Other sockets will go to a &quot;normal&quot; process.\n\n</p>\n<pre><code>var normal = require(&#39;child_process&#39;).fork(&#39;child.js&#39;, [&#39;normal&#39;]);\nvar special = require(&#39;child_process&#39;).fork(&#39;child.js&#39;, [&#39;special&#39;]);\n\n// Open up the server and send sockets to child\nvar server = require(&#39;net&#39;).createServer();\nserver.on(&#39;connection&#39;, function (socket) {\n\n // if this is a VIP\n if (socket.remoteAddress === &#39;74.125.127.100&#39;) {\n special.send(&#39;socket&#39;, socket);\n return;\n }\n // just the usual dudes\n normal.send(&#39;socket&#39;, socket);\n});\nserver.listen(1337);</code></pre>\n<p>The <code>child.js</code> could look like this:\n\n</p>\n<pre><code>process.on(&#39;message&#39;, function(m, socket) {\n if (m === &#39;socket&#39;) {\n socket.end(&#39;You were handled as a &#39; + process.argv[2] + &#39; person&#39;);\n }\n});</code></pre>\n<p>Note that once a single socket has been sent to a child the parent can no\nlonger keep track of when the socket is destroyed. To indicate this condition\nthe <code>.connections</code> property becomes <code>null</code>.\nIt is also recommended not to use <code>.maxConnections</code> in this condition.\n\n</p>\n"
"desc": "<p>When using <code>child_process.fork()</code> you can write to the child using\n<code>child.send(message, [sendHandle])</code> and messages are received by\na <code>&#39;message&#39;</code> event on the child.\n\n</p>\n<p>For example:\n\n</p>\n<pre><code>var cp = require(&#39;child_process&#39;);\n\nvar n = cp.fork(__dirname + &#39;/sub.js&#39;);\n\nn.on(&#39;message&#39;, function(m) {\n console.log(&#39;PARENT got message:&#39;, m);\n});\n\nn.send({ hello: &#39;world&#39; });</code></pre>\n<p>And then the child script, <code>&#39;sub.js&#39;</code> might look like this:\n\n</p>\n<pre><code>process.on(&#39;message&#39;, function(m) {\n console.log(&#39;CHILD got message:&#39;, m);\n});\n\nprocess.send({ foo: &#39;bar&#39; });</code></pre>\n<p>In the child the <code>process</code> object will have a <code>send()</code> method, and <code>process</code>\nwill emit objects each time it receives a message on its channel.\n\n</p>\n<p>There is a special case when sending a <code>{cmd: &#39;NODE_foo&#39;}</code> message. All messages\ncontaining a <code>NODE_</code> prefix in its <code>cmd</code> property will not be emitted in\nthe <code>message</code> event, since they are internal messages used by node core.\nMessages containing the prefix are emitted in the <code>internalMessage</code> event, you\nshould by all means avoid using this feature, it is subject to change without notice.\n\n</p>\n<p>The <code>sendHandle</code> option to <code>child.send()</code> is for sending a TCP server or\nsocket object to another process. The child will receive the object as its\nsecond argument to the <code>message</code> event.\n\n</p>\n<p>Emits an <code>&#39;error&#39;</code> event if the message cannot be sent, for example because\nthe child process has already exited.\n\n</p>\n<h4>Example: sending server object</h4>\n<p>Here is an example of sending a server:\n\n</p>\n<pre><code>var child = require(&#39;child_process&#39;).fork(&#39;child.js&#39;);\n\n// Open up the server object and send the handle.\nvar server = require(&#39;net&#39;).createServer();\nserver.on(&#39;connection&#39;, function (socket) {\n socket.end(&#39;handled by parent&#39;);\n});\nserver.listen(1337, function() {\n child.send(&#39;server&#39;, server);\n});</code></pre>\n<p>And the child would the receive the server object as:\n\n</p>\n<pre><code>process.on(&#39;message&#39;, function(m, server) {\n if (m === &#39;server&#39;) {\n server.on(&#39;connection&#39;, function (socket) {\n socket.end(&#39;handled by child&#39;);\n });\n }\n});</code></pre>\n<p>Note that the server is now shared between the parent and child, this means\nthat some connections will be handled by the parent and some by the child.\n\n</p>\n<p>For <code>dgram</code> servers the workflow is exactly the same. Here you listen on\na <code>message</code> event instead of <code>connection</code> and use <code>server.bind</code> instead of\n<code>server.listen</code>. (Currently only supported on UNIX platforms.)\n\n</p>\n<h4>Example: sending socket object</h4>\n<p>Here is an example of sending a socket. It will spawn two children and handle\nconnections with the remote address <code>74.125.127.100</code> as VIP by sending the\nsocket to a &quot;special&quot; child process. Other sockets will go to a &quot;normal&quot; process.\n\n</p>\n<pre><code>var normal = require(&#39;child_process&#39;).fork(&#39;child.js&#39;, [&#39;normal&#39;]);\nvar special = require(&#39;child_process&#39;).fork(&#39;child.js&#39;, [&#39;special&#39;]);\n\n// Open up the server and send sockets to child\nvar server = require(&#39;net&#39;).createServer();\nserver.on(&#39;connection&#39;, function (socket) {\n\n // if this is a VIP\n if (socket.remoteAddress === &#39;74.125.127.100&#39;) {\n special.send(&#39;socket&#39;, socket);\n return;\n }\n // just the usual dudes\n normal.send(&#39;socket&#39;, socket);\n});\nserver.listen(1337);</code></pre>\n<p>The <code>child.js</code> could look like this:\n\n</p>\n<pre><code>process.on(&#39;message&#39;, function(m, socket) {\n if (m === &#39;socket&#39;) {\n socket.end(&#39;You were handled as a &#39; + process.argv[2] + &#39; person&#39;);\n }\n});</code></pre>\n<p>Note that once a single socket has been sent to a child the parent can no\nlonger keep track of when the socket is destroyed. To indicate this condition\nthe <code>.connections</code> property becomes <code>null</code>.\nIt is also recommended not to use <code>.maxConnections</code> in this condition.\n\n</p>\n"
},
{
"textRaw": "child.disconnect()",
......
......@@ -225,7 +225,7 @@ that some connections will be handled by the parent and some by the child.
For `dgram` servers the workflow is exactly the same. Here you listen on
a `message` event instead of `connection` and use `server.bind` instead of
`server.listen`.
`server.listen`. (Currently only supported on UNIX platforms.)
#### Example: sending socket object
......
......@@ -2,7 +2,7 @@
<html lang="en">
<head>
<meta charset="utf-8">
<title>Cluster Node.js v0.10.8 Manual &amp; Documentation</title>
<title>Cluster Node.js v0.10.9 Manual &amp; Documentation</title>
<link rel="stylesheet" href="assets/style.css">
<link rel="stylesheet" href="assets/sh.css">
<link rel="canonical" href="http://nodejs.org/api/cluster.html">
......@@ -31,7 +31,7 @@
<div id="column1" class="interior">
<header>
<h1>Node.js v0.10.8 Manual &amp; Documentation</h1>
<h1>Node.js v0.10.9 Manual &amp; Documentation</h1>
<div id="gtoc">
<p>
<a href="index.html" name="toc">Index</a> |
......@@ -647,7 +647,7 @@ worker.on(&#39;exit&#39;, function(code, signal) {
<li><a href="http://twitter.com/nodejs" class="twitter">@nodejs</a></li>
</ul>
<p>Copyright <a href="http://joyent.com/">Joyent, Inc</a>, Node.js is a <a href="/trademark-policy.pdf">trademark</a> of Joyent, Inc. View <a href="https://raw.github.com/joyent/node/v0.10.8/LICENSE">license</a>.</p>
<p>Copyright <a href="http://joyent.com/">Joyent, Inc</a>, Node.js is a <a href="/trademark-policy.pdf">trademark</a> of Joyent, Inc. View <a href="https://raw.github.com/joyent/node/v0.10.9/LICENSE">license</a>.</p>
</div>
<script src="../sh_main.js"></script>
......
......@@ -2,7 +2,7 @@
<html lang="en">
<head>
<meta charset="utf-8">
<title>Crypto Node.js v0.10.8 Manual &amp; Documentation</title>
<title>Crypto Node.js v0.10.9 Manual &amp; Documentation</title>
<link rel="stylesheet" href="assets/style.css">
<link rel="stylesheet" href="assets/sh.css">
<link rel="canonical" href="http://nodejs.org/api/crypto.html">
......@@ -31,7 +31,7 @@
<div id="column1" class="interior">
<header>
<h1>Node.js v0.10.8 Manual &amp; Documentation</h1>
<h1>Node.js v0.10.9 Manual &amp; Documentation</h1>
<div id="gtoc">
<p>
<a href="index.html" name="toc">Index</a> |
......@@ -691,7 +691,7 @@ temporary measure.
<li><a href="http://twitter.com/nodejs" class="twitter">@nodejs</a></li>
</ul>
<p>Copyright <a href="http://joyent.com/">Joyent, Inc</a>, Node.js is a <a href="/trademark-policy.pdf">trademark</a> of Joyent, Inc. View <a href="https://raw.github.com/joyent/node/v0.10.8/LICENSE">license</a>.</p>
<p>Copyright <a href="http://joyent.com/">Joyent, Inc</a>, Node.js is a <a href="/trademark-policy.pdf">trademark</a> of Joyent, Inc. View <a href="https://raw.github.com/joyent/node/v0.10.9/LICENSE">license</a>.</p>
</div>
<script src="../sh_main.js"></script>
......
......@@ -2,7 +2,7 @@
<html lang="en">
<head>
<meta charset="utf-8">
<title>Debugger Node.js v0.10.8 Manual &amp; Documentation</title>
<title>Debugger Node.js v0.10.9 Manual &amp; Documentation</title>
<link rel="stylesheet" href="assets/style.css">
<link rel="stylesheet" href="assets/sh.css">
<link rel="canonical" href="http://nodejs.org/api/debugger.html">
......@@ -31,7 +31,7 @@
<div id="column1" class="interior">
<header>
<h1>Node.js v0.10.8 Manual &amp; Documentation</h1>
<h1>Node.js v0.10.9 Manual &amp; Documentation</h1>
<div id="gtoc">
<p>
<a href="index.html" name="toc">Index</a> |
......@@ -252,7 +252,7 @@ The syntax is:
<li><a href="http://twitter.com/nodejs" class="twitter">@nodejs</a></li>
</ul>
<p>Copyright <a href="http://joyent.com/">Joyent, Inc</a>, Node.js is a <a href="/trademark-policy.pdf">trademark</a> of Joyent, Inc. View <a href="https://raw.github.com/joyent/node/v0.10.8/LICENSE">license</a>.</p>
<p>Copyright <a href="http://joyent.com/">Joyent, Inc</a>, Node.js is a <a href="/trademark-policy.pdf">trademark</a> of Joyent, Inc. View <a href="https://raw.github.com/joyent/node/v0.10.9/LICENSE">license</a>.</p>
</div>
<script src="../sh_main.js"></script>
......
......@@ -2,7 +2,7 @@
<html lang="en">
<head>
<meta charset="utf-8">
<title>UDP / Datagram Sockets Node.js v0.10.8 Manual &amp; Documentation</title>
<title>UDP / Datagram Sockets Node.js v0.10.9 Manual &amp; Documentation</title>
<link rel="stylesheet" href="assets/style.css">
<link rel="stylesheet" href="assets/sh.css">
<link rel="canonical" href="http://nodejs.org/api/dgram.html">
......@@ -31,7 +31,7 @@
<div id="column1" class="interior">
<header>
<h1>Node.js v0.10.8 Manual &amp; Documentation</h1>
<h1>Node.js v0.10.9 Manual &amp; Documentation</h1>
<div id="gtoc">
<p>
<a href="index.html" name="toc">Index</a> |
......@@ -351,7 +351,7 @@ the socket is <code>ref</code>d calling <code>ref</code> again will have no effe
<li><a href="http://twitter.com/nodejs" class="twitter">@nodejs</a></li>
</ul>
<p>Copyright <a href="http://joyent.com/">Joyent, Inc</a>, Node.js is a <a href="/trademark-policy.pdf">trademark</a> of Joyent, Inc. View <a href="https://raw.github.com/joyent/node/v0.10.8/LICENSE">license</a>.</p>
<p>Copyright <a href="http://joyent.com/">Joyent, Inc</a>, Node.js is a <a href="/trademark-policy.pdf">trademark</a> of Joyent, Inc. View <a href="https://raw.github.com/joyent/node/v0.10.9/LICENSE">license</a>.</p>
</div>
<script src="../sh_main.js"></script>
......
......@@ -2,7 +2,7 @@
<html lang="en">
<head>
<meta charset="utf-8">
<title>DNS Node.js v0.10.8 Manual &amp; Documentation</title>
<title>DNS Node.js v0.10.9 Manual &amp; Documentation</title>
<link rel="stylesheet" href="assets/style.css">
<link rel="stylesheet" href="assets/sh.css">
<link rel="canonical" href="http://nodejs.org/api/dns.html">
......@@ -31,7 +31,7 @@
<div id="column1" class="interior">
<header>
<h1>Node.js v0.10.8 Manual &amp; Documentation</h1>
<h1>Node.js v0.10.9 Manual &amp; Documentation</h1>
<div id="gtoc">
<p>
<a href="index.html" name="toc">Index</a> |
......@@ -237,7 +237,7 @@ one of the error codes listed below.
<li><a href="http://twitter.com/nodejs" class="twitter">@nodejs</a></li>
</ul>
<p>Copyright <a href="http://joyent.com/">Joyent, Inc</a>, Node.js is a <a href="/trademark-policy.pdf">trademark</a> of Joyent, Inc. View <a href="https://raw.github.com/joyent/node/v0.10.8/LICENSE">license</a>.</p>
<p>Copyright <a href="http://joyent.com/">Joyent, Inc</a>, Node.js is a <a href="/trademark-policy.pdf">trademark</a> of Joyent, Inc. View <a href="https://raw.github.com/joyent/node/v0.10.9/LICENSE">license</a>.</p>
</div>
<script src="../sh_main.js"></script>
......
......@@ -2,7 +2,7 @@
<html lang="en">
<head>
<meta charset="utf-8">
<title>About this Documentation Node.js v0.10.8 Manual &amp; Documentation</title>
<title>About this Documentation Node.js v0.10.9 Manual &amp; Documentation</title>
<link rel="stylesheet" href="assets/style.css">
<link rel="stylesheet" href="assets/sh.css">
<link rel="canonical" href="http://nodejs.org/api/documentation.html">
......@@ -31,7 +31,7 @@
<div id="column1" class="interior">
<header>
<h1>Node.js v0.10.8 Manual &amp; Documentation</h1>
<h1>Node.js v0.10.9 Manual &amp; Documentation</h1>
<div id="gtoc">
<p>
<a href="index.html" name="toc">Index</a> |
......@@ -135,7 +135,7 @@ same data.
<li><a href="http://twitter.com/nodejs" class="twitter">@nodejs</a></li>
</ul>
<p>Copyright <a href="http://joyent.com/">Joyent, Inc</a>, Node.js is a <a href="/trademark-policy.pdf">trademark</a> of Joyent, Inc. View <a href="https://raw.github.com/joyent/node/v0.10.8/LICENSE">license</a>.</p>
<p>Copyright <a href="http://joyent.com/">Joyent, Inc</a>, Node.js is a <a href="/trademark-policy.pdf">trademark</a> of Joyent, Inc. View <a href="https://raw.github.com/joyent/node/v0.10.9/LICENSE">license</a>.</p>
</div>
<script src="../sh_main.js"></script>
......
......@@ -2,7 +2,7 @@
<html lang="en">
<head>
<meta charset="utf-8">
<title>Domain Node.js v0.10.8 Manual &amp; Documentation</title>
<title>Domain Node.js v0.10.9 Manual &amp; Documentation</title>
<link rel="stylesheet" href="assets/style.css">
<link rel="stylesheet" href="assets/sh.css">
<link rel="canonical" href="http://nodejs.org/api/domain.html">
......@@ -31,7 +31,7 @@
<div id="column1" class="interior">
<header>
<h1>Node.js v0.10.8 Manual &amp; Documentation</h1>
<h1>Node.js v0.10.9 Manual &amp; Documentation</h1>
<div id="gtoc">
<p>
<a href="index.html" name="toc">Index</a> |
......@@ -511,7 +511,7 @@ in flight, Node.js will not communicate further about them.
<li><a href="http://twitter.com/nodejs" class="twitter">@nodejs</a></li>
</ul>
<p>Copyright <a href="http://joyent.com/">Joyent, Inc</a>, Node.js is a <a href="/trademark-policy.pdf">trademark</a> of Joyent, Inc. View <a href="https://raw.github.com/joyent/node/v0.10.8/LICENSE">license</a>.</p>
<p>Copyright <a href="http://joyent.com/">Joyent, Inc</a>, Node.js is a <a href="/trademark-policy.pdf">trademark</a> of Joyent, Inc. View <a href="https://raw.github.com/joyent/node/v0.10.9/LICENSE">license</a>.</p>
</div>
<script src="../sh_main.js"></script>
......
......@@ -2,7 +2,7 @@
<html lang="en">
<head>
<meta charset="utf-8">
<title>Events Node.js v0.10.8 Manual &amp; Documentation</title>
<title>Events Node.js v0.10.9 Manual &amp; Documentation</title>
<link rel="stylesheet" href="assets/style.css">
<link rel="stylesheet" href="assets/sh.css">
<link rel="canonical" href="http://nodejs.org/api/events.html">
......@@ -31,7 +31,7 @@
<div id="column1" class="interior">
<header>
<h1>Node.js v0.10.8 Manual &amp; Documentation</h1>
<h1>Node.js v0.10.9 Manual &amp; Documentation</h1>
<div id="gtoc">
<p>
<a href="index.html" name="toc">Index</a> |
......@@ -209,7 +209,7 @@ console.log(util.inspect(server.listeners(&#39;connection&#39;))); // [ [Functio
<li><a href="http://twitter.com/nodejs" class="twitter">@nodejs</a></li>
</ul>
<p>Copyright <a href="http://joyent.com/">Joyent, Inc</a>, Node.js is a <a href="/trademark-policy.pdf">trademark</a> of Joyent, Inc. View <a href="https://raw.github.com/joyent/node/v0.10.8/LICENSE">license</a>.</p>
<p>Copyright <a href="http://joyent.com/">Joyent, Inc</a>, Node.js is a <a href="/trademark-policy.pdf">trademark</a> of Joyent, Inc. View <a href="https://raw.github.com/joyent/node/v0.10.9/LICENSE">license</a>.</p>
</div>
<script src="../sh_main.js"></script>
......
......@@ -2,7 +2,7 @@
<html lang="en">
<head>
<meta charset="utf-8">
<title>File System Node.js v0.10.8 Manual &amp; Documentation</title>
<title>File System Node.js v0.10.9 Manual &amp; Documentation</title>
<link rel="stylesheet" href="assets/style.css">
<link rel="stylesheet" href="assets/sh.css">
<link rel="canonical" href="http://nodejs.org/api/fs.html">
......@@ -31,7 +31,7 @@
<div id="column1" class="interior">
<header>
<h1>Node.js v0.10.8 Manual &amp; Documentation</h1>
<h1>Node.js v0.10.9 Manual &amp; Documentation</h1>
<div id="gtoc">
<p>
<a href="index.html" name="toc">Index</a> |
......@@ -824,7 +824,6 @@ be found in the <a href="https://developer.mozilla.org/en/JavaScript/Reference/G
encoding: null,
fd: null,
mode: 0666,
bufferSize: 64 * 1024,
autoClose: true
}</code></pre>
<p><code>options</code> can include <code>start</code> and <code>end</code> values to read a range of bytes from
......@@ -929,7 +928,7 @@ See more details in <a href="#fs_fs_watch_filename_options_listener">fs.watch</a
<li><a href="http://twitter.com/nodejs" class="twitter">@nodejs</a></li>
</ul>
<p>Copyright <a href="http://joyent.com/">Joyent, Inc</a>, Node.js is a <a href="/trademark-policy.pdf">trademark</a> of Joyent, Inc. View <a href="https://raw.github.com/joyent/node/v0.10.8/LICENSE">license</a>.</p>
<p>Copyright <a href="http://joyent.com/">Joyent, Inc</a>, Node.js is a <a href="/trademark-policy.pdf">trademark</a> of Joyent, Inc. View <a href="https://raw.github.com/joyent/node/v0.10.9/LICENSE">license</a>.</p>
</div>
<script src="../sh_main.js"></script>
......
......@@ -1507,7 +1507,7 @@
"textRaw": "fs.createReadStream(path, [options])",
"type": "method",
"name": "createReadStream",
"desc": "<p>Returns a new ReadStream object (See <code>Readable Stream</code>).\n\n</p>\n<p><code>options</code> is an object with the following defaults:\n\n</p>\n<pre><code>{ flags: &#39;r&#39;,\n encoding: null,\n fd: null,\n mode: 0666,\n bufferSize: 64 * 1024,\n autoClose: true\n}</code></pre>\n<p><code>options</code> can include <code>start</code> and <code>end</code> values to read a range of bytes from\nthe file instead of the entire file. Both <code>start</code> and <code>end</code> are inclusive and\nstart at 0. The <code>encoding</code> can be <code>&#39;utf8&#39;</code>, <code>&#39;ascii&#39;</code>, or <code>&#39;base64&#39;</code>.\n\n</p>\n<p>If <code>autoClose</code> is false, then the file descriptor won&#39;t be closed, even if\nthere&#39;s an error. It is your responsiblity to close it and make sure\nthere&#39;s no file descriptor leak. If <code>autoClose</code> is set to true (default\nbehavior), on <code>error</code> or <code>end</code> the file descriptor will be closed\nautomatically.\n\n</p>\n<p>An example to read the last 10 bytes of a file which is 100 bytes long:\n\n</p>\n<pre><code>fs.createReadStream(&#39;sample.txt&#39;, {start: 90, end: 99});</code></pre>\n",
"desc": "<p>Returns a new ReadStream object (See <code>Readable Stream</code>).\n\n</p>\n<p><code>options</code> is an object with the following defaults:\n\n</p>\n<pre><code>{ flags: &#39;r&#39;,\n encoding: null,\n fd: null,\n mode: 0666,\n autoClose: true\n}</code></pre>\n<p><code>options</code> can include <code>start</code> and <code>end</code> values to read a range of bytes from\nthe file instead of the entire file. Both <code>start</code> and <code>end</code> are inclusive and\nstart at 0. The <code>encoding</code> can be <code>&#39;utf8&#39;</code>, <code>&#39;ascii&#39;</code>, or <code>&#39;base64&#39;</code>.\n\n</p>\n<p>If <code>autoClose</code> is false, then the file descriptor won&#39;t be closed, even if\nthere&#39;s an error. It is your responsiblity to close it and make sure\nthere&#39;s no file descriptor leak. If <code>autoClose</code> is set to true (default\nbehavior), on <code>error</code> or <code>end</code> the file descriptor will be closed\nautomatically.\n\n</p>\n<p>An example to read the last 10 bytes of a file which is 100 bytes long:\n\n</p>\n<pre><code>fs.createReadStream(&#39;sample.txt&#39;, {start: 90, end: 99});</code></pre>\n",
"signatures": [
{
"params": [
......
......@@ -650,7 +650,6 @@ Returns a new ReadStream object (See `Readable Stream`).
encoding: null,
fd: null,
mode: 0666,
bufferSize: 64 * 1024,
autoClose: true
}
......
......@@ -2,7 +2,7 @@
<html lang="en">
<head>
<meta charset="utf-8">
<title>Global Objects Node.js v0.10.8 Manual &amp; Documentation</title>
<title>Global Objects Node.js v0.10.9 Manual &amp; Documentation</title>
<link rel="stylesheet" href="assets/style.css">
<link rel="stylesheet" href="assets/sh.css">
<link rel="canonical" href="http://nodejs.org/api/globals.html">
......@@ -31,7 +31,7 @@
<div id="column1" class="interior">
<header>
<h1>Node.js v0.10.8 Manual &amp; Documentation</h1>
<h1>Node.js v0.10.9 Manual &amp; Documentation</h1>
<div id="gtoc">
<p>
<a href="index.html" name="toc">Index</a> |
......@@ -292,7 +292,7 @@ will not execute.
<li><a href="http://twitter.com/nodejs" class="twitter">@nodejs</a></li>
</ul>
<p>Copyright <a href="http://joyent.com/">Joyent, Inc</a>, Node.js is a <a href="/trademark-policy.pdf">trademark</a> of Joyent, Inc. View <a href="https://raw.github.com/joyent/node/v0.10.8/LICENSE">license</a>.</p>
<p>Copyright <a href="http://joyent.com/">Joyent, Inc</a>, Node.js is a <a href="/trademark-policy.pdf">trademark</a> of Joyent, Inc. View <a href="https://raw.github.com/joyent/node/v0.10.9/LICENSE">license</a>.</p>
</div>
<script src="../sh_main.js"></script>
......
......@@ -2,7 +2,7 @@
<html lang="en">
<head>
<meta charset="utf-8">
<title>HTTP Node.js v0.10.8 Manual &amp; Documentation</title>
<title>HTTP Node.js v0.10.9 Manual &amp; Documentation</title>
<link rel="stylesheet" href="assets/style.css">
<link rel="stylesheet" href="assets/sh.css">
<link rel="canonical" href="http://nodejs.org/api/http.html">
......@@ -31,7 +31,7 @@
<div id="column1" class="interior">
<header>
<h1>Node.js v0.10.8 Manual &amp; Documentation</h1>
<h1>Node.js v0.10.9 Manual &amp; Documentation</h1>
<div id="gtoc">
<p>
<a href="index.html" name="toc">Index</a> |
......@@ -1085,7 +1085,7 @@ authentication details.
<li><a href="http://twitter.com/nodejs" class="twitter">@nodejs</a></li>
</ul>
<p>Copyright <a href="http://joyent.com/">Joyent, Inc</a>, Node.js is a <a href="/trademark-policy.pdf">trademark</a> of Joyent, Inc. View <a href="https://raw.github.com/joyent/node/v0.10.8/LICENSE">license</a>.</p>
<p>Copyright <a href="http://joyent.com/">Joyent, Inc</a>, Node.js is a <a href="/trademark-policy.pdf">trademark</a> of Joyent, Inc. View <a href="https://raw.github.com/joyent/node/v0.10.9/LICENSE">license</a>.</p>
</div>
<script src="../sh_main.js"></script>
......
......@@ -2,7 +2,7 @@
<html lang="en">
<head>
<meta charset="utf-8">