Fix HTTP keep-alive

This commit is contained in:
Ryan Dahl 2010-03-23 21:10:01 -07:00
parent 6b6dcf4aad
commit 70ffdf5db9
2 changed files with 3 additions and 3 deletions

View File

@ -517,7 +517,7 @@ function connectionListener (socket) {
var req = incoming; var req = incoming;
var res = new ServerResponse(req); var res = new ServerResponse(req);
res.shouldKeepAlive = shouldKeepAlive; res.should_keep_alive = shouldKeepAlive;
res.addListener('flush', function () { res.addListener('flush', function () {
if (flushMessageQueue(socket, responses)) { if (flushMessageQueue(socket, responses)) {
socket.close(); socket.close();

View File

@ -1,7 +1,7 @@
// This test requires the program "ab" // This test requires the program "ab"
require("../common"); require("../common");
http = require("http"); http = require("http");
sys = require("sys"); exec = require("child_process").exec;
body = "hello world\n"; body = "hello world\n";
server = http.createServer(function (req, res) { server = http.createServer(function (req, res) {
@ -20,7 +20,7 @@ var normalReqSec = 0;
function runAb(opts, callback) { function runAb(opts, callback) {
var command = "ab " + opts + " http://127.0.0.1:" + PORT + "/"; var command = "ab " + opts + " http://127.0.0.1:" + PORT + "/";
sys.exec(command, function (err, stdout, stderr) { exec(command, function (err, stdout, stderr) {
if (err) { if (err) {
puts("ab not installed? skipping test.\n" + stderr); puts("ab not installed? skipping test.\n" + stderr);
process.exit(); process.exit();