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(this); return true; } + inline Failure* ToFailureUnchecked() { + ASSERT(IsFailure()); + return reinterpret_cast(this); + } inline Object* ToObjectUnchecked() { ASSERT(!IsFailure()); return reinterpret_cast(this); diff --git a/deps/v8/src/top.cc b/deps/v8/src/top.cc index 78db26a509..d6fcf1009b 100644 --- a/deps/v8/src/top.cc +++ b/deps/v8/src/top.cc @@ -1,4 +1,4 @@ -// Copyright 2006-2008 the V8 project authors. All rights reserved. +// Copyright 2011 the V8 project authors. All rights reserved. // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: @@ -740,6 +740,7 @@ Failure* Top::ReThrow(MaybeObject* exception, MessageLocation* location) { // Set the exception being re-thrown. set_pending_exception(exception); + if (exception->IsFailure()) return exception->ToFailureUnchecked(); return Failure::Exception(); } diff --git a/deps/v8/src/version.cc b/deps/v8/src/version.cc index 0673517eb0..ccfbd18c5f 100644 --- a/deps/v8/src/version.cc +++ b/deps/v8/src/version.cc @@ -35,7 +35,7 @@ #define MAJOR_VERSION 3 #define MINOR_VERSION 1 #define BUILD_NUMBER 8 -#define PATCH_LEVEL 14 +#define PATCH_LEVEL 16 #define CANDIDATE_VERSION false // Define SONAME to have the SCons build the put a specific SONAME into the diff --git a/deps/v8/src/x64/assembler-x64.cc b/deps/v8/src/x64/assembler-x64.cc index 41111a7780..35c05b3ac3 100644 --- a/deps/v8/src/x64/assembler-x64.cc +++ b/deps/v8/src/x64/assembler-x64.cc @@ -1379,7 +1379,7 @@ void Assembler::jmp(NearLabel* L) { EnsureSpace ensure_space(this); last_pc_ = pc_; if (L->is_bound()) { - const int short_size = sizeof(int8_t); + const int short_size = 2; int offs = L->pos() - pc_offset(); ASSERT(offs <= 0); ASSERT(is_int8(offs - short_size)); From 7dd22c26e4365698dc3efddf138c4d399cb912c8 Mon Sep 17 00:00:00 2001 From: Ryan Dahl Date: Fri, 20 May 2011 19:40:06 -0700 Subject: [PATCH 4/5] Bump to v0.4.8 --- ChangeLog | 40 ++++++++++++++++++++++++++++++++++++++++ doc/index.html | 8 ++++---- src/node_version.h | 2 +- wscript | 2 +- 4 files changed, 46 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index e1f8c4c3c8..867d8cd04e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,43 @@ +2011.05.20, Version 0.4.8 (stable) + +* #974 Properly report traceless errors (isaacs) + +* #983 Better JSON.parse error detection in REPL (isaacs) + +* #836 Agent socket errors bubble up to req only if req exists + +* #1041 Fix event listener leak check timing (koichik) + +* #1038 Fix dns.resolve() with 'PTR' throws Error: Unknown type "PTR" + (koichik) + +* #1073 Share SSL context between server connections (Fedor Indutny) + +* Disable compression with OpenSSL. Improves memory perf. + +* Implement os.totalmem() and os.freemem() for SunOS (Alexandre Marangone) + +* Fix a special characters in URL regression (isaacs) + +* Fix idle timeouts in HTTPS (Felix Geisendörfer) + +* SlowBuffer.write() with 'ucs2' throws ReferenceError. (koichik) + +* http.ServerRequest 'close' sometimes gets an error argument + (Felix Geisendörfer) + +* Doc improvements + +* cleartextstream.destroy() should close(2) the socket. Previously was being + mapped to a shutdown(2) syscall. + +* No longer compile out asserts and debug statements in normal build. + +* Debugger improvements. + +* Upgrade V8 to 3.1.8.16. + + 2011.04.22, Version 0.4.7 (stable) * Don't emit error on ECONNRESET from read() #670 diff --git a/doc/index.html b/doc/index.html index 758f02f8e5..c4dc5f16ac 100644 --- a/doc/index.html +++ b/doc/index.html @@ -26,7 +26,7 @@
  • Download
  • ChangeLog
  • About
  • -
  • v0.4.7 docs
  • +
  • v0.4.8 docs

  • Wiki
  • Blog
  • @@ -108,9 +108,9 @@ server.listen(1337, "127.0.0.1");

    - 2011.04.22 - node-v0.4.7.tar.gz - (Documentation) + 2011.05.20 + node-v0.4.8.tar.gz + (Documentation)

    Historical: versions, docs

    diff --git a/src/node_version.h b/src/node_version.h index 3eeeb73934..852c695410 100644 --- a/src/node_version.h +++ b/src/node_version.h @@ -28,7 +28,7 @@ #define NODE_MAJOR_VERSION 0 #define NODE_MINOR_VERSION 4 #define NODE_PATCH_VERSION 8 -#define NODE_VERSION_IS_RELEASE 0 +#define NODE_VERSION_IS_RELEASE 1 #ifndef NODE_STRINGIFY #define NODE_STRINGIFY(n) NODE_STRINGIFY_HELPER(n) diff --git a/wscript b/wscript index 3d978d7c78..e99a05d88f 100644 --- a/wscript +++ b/wscript @@ -854,7 +854,7 @@ def build(bld): , 'CPPFLAGS' : " ".join(program.env["CPPFLAGS"]).replace('"', '\\"') , 'LIBFLAGS' : " ".join(program.env["LIBFLAGS"]).replace('"', '\\"') , 'PREFIX' : safe_path(program.env["PREFIX"]) - , 'VERSION' : '0.4.7' # FIXME should not be hard-coded, see NODE_VERSION_STRING in src/node_version. + , 'VERSION' : '0.4.8' # FIXME should not be hard-coded, see NODE_VERSION_STRING in src/node_version. } return x From 823604a4e0a6120ade470e98f8c0058d3fd0de05 Mon Sep 17 00:00:00 2001 From: Ryan Dahl Date: Sat, 21 May 2011 00:10:23 -0700 Subject: [PATCH 5/5] Now working on v0.4.9 --- src/node_version.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/node_version.h b/src/node_version.h index 852c695410..c723a77c9e 100644 --- a/src/node_version.h +++ b/src/node_version.h @@ -27,8 +27,8 @@ #define NODE_MAJOR_VERSION 0 #define NODE_MINOR_VERSION 4 -#define NODE_PATCH_VERSION 8 -#define NODE_VERSION_IS_RELEASE 1 +#define NODE_PATCH_VERSION 9 +#define NODE_VERSION_IS_RELEASE 0 #ifndef NODE_STRINGIFY #define NODE_STRINGIFY(n) NODE_STRINGIFY_HELPER(n)