Fix HTTP keep-alive
This commit is contained in:
parent
6b6dcf4aad
commit
70ffdf5db9
@ -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();
|
||||||
|
@ -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();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user