From a55a9ff3c2e913f20230535fde1fcb703e25c996 Mon Sep 17 00:00:00 2001
From: Mark Cavage
Date: Fri, 20 May 2011 14:38:49 -0700
Subject: [PATCH 1/5] Additional docs for net.listenFD()
Fixes #1080.
---
doc/api/net.markdown | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/doc/api/net.markdown b/doc/api/net.markdown
index 16baacb3de..8c6667a743 100644
--- a/doc/api/net.markdown
+++ b/doc/api/net.markdown
@@ -104,12 +104,13 @@ when the server has been bound.
Start a server listening for connections on the given file descriptor.
This file descriptor must have already had the `bind(2)` and `listen(2)` system
-calls invoked on it.
+calls invoked on it. Additionally, it must be set non-blocking; try
+`fcntl(fd, F_SETFL, O_NONBLOCK)`.
#### server.pause(msecs)
-Stop accepting connections for the given number of milliseconds (default is
-one second). This could be useful for throttling new connections against
+Stop accepting connections for the given number of milliseconds (default is
+one second). This could be useful for throttling new connections against
DoS attacks or other oversubscription.
#### server.close()
From 70dd6d4ea369ccbfd6e573d9a42b5144dc23b4b3 Mon Sep 17 00:00:00 2001
From: Ryan Dahl
Date: Fri, 20 May 2011 15:39:48 -0700
Subject: [PATCH 2/5] Fix TJ's assert error
Unable to reproduce but connect's "make test TESTS=test/static.test.js" does
it occasionally.
---
lib/http.js | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/lib/http.js b/lib/http.js
index d7c008313d..a8602fdbbb 100644
--- a/lib/http.js
+++ b/lib/http.js
@@ -1089,7 +1089,11 @@ function connectionListener(socket) {
// When we're finished writing the response, check if this is the last
// respose, if so destroy the socket.
res.on('finish', function() {
- assert(incoming[0] === req);
+ // Usually the first incoming element should be our request. it may
+ // be that in the case abortIncoming() was called that the incoming
+ // array will be empty.
+ assert(incoming.length == 0 || incoming[0] === req);
+
incoming.shift();
res.detachSocket(socket);
From cee4ce39a94e105bb4f1a1b5e3df949d8e044d84 Mon Sep 17 00:00:00 2001
From: Ryan Dahl
Date: Fri, 20 May 2011 19:24:37 -0700
Subject: [PATCH 3/5] Upgrade V8 to 3.1.8.16
---
deps/v8/src/objects.h | 5 +++++
deps/v8/src/top.cc | 3 ++-
deps/v8/src/version.cc | 2 +-
deps/v8/src/x64/assembler-x64.cc | 2 +-
4 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/deps/v8/src/objects.h b/deps/v8/src/objects.h
index de15a7398d..406895a4e6 100644
--- a/deps/v8/src/objects.h
+++ b/deps/v8/src/objects.h
@@ -585,6 +585,7 @@ enum CompareResult {
class StringStream;
class ObjectVisitor;
+class Failure;
struct ValueInfo : public Malloced {
ValueInfo() : type(FIRST_TYPE), ptr(NULL), str(NULL), number(0) { }
@@ -611,6 +612,10 @@ class MaybeObject BASE_EMBEDDED {
*obj = reinterpret_cast