Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
remove the unecessary IIFE
  • Loading branch information
chungngoops committed Nov 27, 2017
commit 87d76b5560b7d43a821413b1847f4d34ef5fe1a8
34 changes: 16 additions & 18 deletions test/parallel/test-http-pipe-fs.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,24 +44,22 @@ const server = http.createServer(common.mustCall(function(req, res) {
http.globalAgent.maxSockets = 1;

for (let i = 0; i < NUMBER_OF_STREAMS; ++i) {
(function(i) {
const req = http.request({
port: server.address().port,
method: 'POST',
headers: {
'Content-Length': 5
}
}, function(res) {
res.on('end', function() {
console.error(`res${i} end`);
countdown.dec();
});
res.resume();
const req = http.request({
port: server.address().port,
method: 'POST',
headers: {
'Content-Length': 5
}
}, function(res) {
res.on('end', function() {
console.error(`res${i + 1} end`);
countdown.dec();
});
req.on('socket', function(s) {
console.error(`req${i} start`);
});
req.end('12345');
}(i + 1));
res.resume();
});
req.on('socket', function(s) {
console.error(`req${i + 1} start`);
});
req.end('12345');
}
});