projects
/
platform
/
upstream
/
nodejs.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a3e3ad4
)
net_uv: Add maxConnections support
author
Henry Rawas
<henryr@schakra.com>
Thu, 14 Jul 2011 20:18:28 +0000
(13:18 -0700)
committer
Ryan Dahl
<ry@tinyclouds.org>
Thu, 14 Jul 2011 20:23:08 +0000
(13:23 -0700)
Makefile
patch
|
blob
|
history
lib/net_uv.js
patch
|
blob
|
history
diff --git
a/Makefile
b/Makefile
index
13987a4
..
2ae4d20
100644
(file)
--- a/
Makefile
+++ b/
Makefile
@@
-139,6
+139,7
@@
test-uv: all
simple/test-net-pingpong \
simple/test-net-reconnect \
simple/test-net-remote-address-port \
+ simple/test-net-server-max-connections \
simple/test-net-server-try-ports \
simple/test-net-stream \
simple/test-net-socket-timeout \
diff --git
a/lib/net_uv.js
b/lib/net_uv.js
index
de672b6
..
816529a
100644
(file)
--- a/
lib/net_uv.js
+++ b/
lib/net_uv.js
@@
-538,6
+538,11
@@
function onconnection(clientHandle) {
debug("onconnection");
+ if (self.maxConnections && self.connections >= self.maxConnections) {
+ clientHandle.close();
+ return;
+ }
+
var socket = new Socket({
handle: clientHandle,
allowHalfOpen: self.allowHalfOpen