This commit is contained in:
dead_horse 2016-07-22 19:03:34 +08:00
parent 4e969b54b2
commit c2c626f308

View file

@ -8,7 +8,7 @@ var net = require('net');
describe('res.writable', function(){ describe('res.writable', function(){
describe('when continuous requests in one persistent connection', function() { describe('when continuous requests in one persistent connection', function() {
function requestTwice(server, done) { function requestTwice(server, done) {
let port = server.address().port; var port = server.address().port;
var buf = new Buffer('GET / HTTP/1.1\r\nHost: localhost:' + port + '\r\nConnection: keep-alive\r\n\r\n'); var buf = new Buffer('GET / HTTP/1.1\r\nHost: localhost:' + port + '\r\nConnection: keep-alive\r\n\r\n');
var client = net.connect(port); var client = net.connect(port);
var datas = []; var datas = [];
@ -51,7 +51,7 @@ describe('res.writable', function(){
describe('when socket closed before response sent', function() { describe('when socket closed before response sent', function() {
function requsetClosed(server) { function requsetClosed(server) {
let port = server.address().port; var port = server.address().port;
var buf = new Buffer('GET / HTTP/1.1\r\nHost: localhost:' + port + '\r\nConnection: keep-alive\r\n\r\n'); var buf = new Buffer('GET / HTTP/1.1\r\nHost: localhost:' + port + '\r\nConnection: keep-alive\r\n\r\n');
var client = net.connect(port); var client = net.connect(port);
setImmediate(function() { setImmediate(function() {
@ -72,9 +72,9 @@ describe('res.writable', function(){
}) })
}) })
describe('when resposne finished', function() { describe('when response finished', function() {
function request(server) { function request(server) {
let port = server.address().port; var port = server.address().port;
var buf = new Buffer('GET / HTTP/1.1\r\nHost: localhost:' + port + '\r\nConnection: keep-alive\r\n\r\n'); var buf = new Buffer('GET / HTTP/1.1\r\nHost: localhost:' + port + '\r\nConnection: keep-alive\r\n\r\n');
var client = net.connect(port); var client = net.connect(port);
setImmediate(function() { setImmediate(function() {