From 62277ab79b5cbdaba45693b33bfd55d61caa2f4a Mon Sep 17 00:00:00 2001 From: Ryan Dahl Date: Thu, 8 Apr 2010 01:00:29 -0700 Subject: [PATCH] Support both old and new HTTP closing APIs in benchmark program --- benchmark/http_simple.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/benchmark/http_simple.js b/benchmark/http_simple.js index 9bfeadb2cc5..4d9369c52a1 100644 --- a/benchmark/http_simple.js +++ b/benchmark/http_simple.js @@ -1,7 +1,7 @@ path = require("path"); var puts = require("sys").puts; -var old = false; +var old = true; http = require(old ? "http_old" : 'http'); if (old) puts('old version'); @@ -52,6 +52,10 @@ http.createServer(function (req, res) { , "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);