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:
432a2e4
)
bench: add /echo endpoint to http_simple
author
Ben Noordhuis
<info@bnoordhuis.nl>
Fri, 30 Dec 2011 01:03:08 +0000
(
02:03
+0100)
committer
Ben Noordhuis
<info@bnoordhuis.nl>
Fri, 30 Dec 2011 01:03:10 +0000
(
02:03
+0100)
Copies the POST request data verbatim into the response body.
benchmark/http_simple.js
patch
|
blob
|
history
diff --git
a/benchmark/http_simple.js
b/benchmark/http_simple.js
index
4b55028
..
74ba4d7
100644
(file)
--- a/
benchmark/http_simple.js
+++ b/
benchmark/http_simple.js
@@
-54,6
+54,12
@@
var server = http.createServer(function (req, res) {
} else if (command == "fixed") {
body = fixed;
+ } else if (command == "echo") {
+ res.writeHead(200, { "Content-Type": "text/plain",
+ "Transfer-Encoding": "chunked" });
+ req.pipe(res);
+ return;
+
} else {
status = 404;
body = "not found\n";