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:
cb84cde
)
Support both old and new HTTP closing APIs in benchmark program
author
Ryan Dahl
<ry@tinyclouds.org>
Thu, 8 Apr 2010 08:00:29 +0000
(
01:00
-0700)
committer
Ryan Dahl
<ry@tinyclouds.org>
Thu, 8 Apr 2010 08:00:35 +0000
(
01:00
-0700)
benchmark/http_simple.js
patch
|
blob
|
history
diff --git
a/benchmark/http_simple.js
b/benchmark/http_simple.js
index
9bfeadb
..
4d9369c
100644
(file)
--- a/
benchmark/http_simple.js
+++ b/
benchmark/http_simple.js
@@
-1,7
+1,7
@@
path = require("path");
var puts = require("sys").puts;
path = require("path");
var puts = require("sys").puts;
-var old =
fals
e;
+var old =
tru
e;
http = require(old ? "http_old" : 'http');
if (old) puts('old version');
http = require(old ? "http_old" : 'http');
if (old) puts('old version');
@@
-52,6
+52,10
@@
http.createServer(function (req, res) {
, "Content-Length": content_length
}
);
, "Content-Length": content_length
}
);
- if (old) res.write(body, 'ascii');
- res.close(body, 'ascii');
+ if (old) {
+ res.write(body, 'ascii');
+ res.close();
+ } else {
+ res.close(body, 'ascii');
+ }
}).listen(8000);
}).listen(8000);