Skip to content

Commit 62277ab

Browse files
committed
Support both old and new HTTP closing APIs in benchmark program
1 parent cb84cde commit 62277ab

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

benchmark/http_simple.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
path = require("path");
22

33
var puts = require("sys").puts;
4-
var old = false;
4+
var old = true;
55

66
http = require(old ? "http_old" : 'http');
77
if (old) puts('old version');
@@ -52,6 +52,10 @@ http.createServer(function (req, res) {
5252
, "Content-Length": content_length
5353
}
5454
);
55-
if (old) res.write(body, 'ascii');
56-
res.close(body, 'ascii');
55+
if (old) {
56+
res.write(body, 'ascii');
57+
res.close();
58+
} else {
59+
res.close(body, 'ascii');
60+
}
5761
}).listen(8000);

0 commit comments

Comments
 (0)