-
Notifications
You must be signed in to change notification settings - Fork 29.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
http: fix out-of-order 'finish' bug in pipelining
Changes to `stream_base.cc` are required to support empty writes. Fixes CVE-2015-7384, #3138 Fix: #2639 PR-URL: #3128
- Loading branch information
Showing
3 changed files
with
39 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
'use strict'; | ||
const common = require('../common'); | ||
const assert = require('assert'); | ||
const http = require('http'); | ||
const net = require('net'); | ||
|
||
const COUNT = 10; | ||
|
||
var received = 0; | ||
|
||
var server = http.createServer(function(req, res) { | ||
// Close the server, we have only one TCP connection anyway | ||
if (received++ === 0) | ||
server.close(); | ||
|
||
res.writeHead(200); | ||
res.write('data'); | ||
|
||
setTimeout(function() { | ||
res.end(); | ||
}, (Math.random() * 100) | 0); | ||
}).listen(common.PORT, function() { | ||
const s = net.connect(common.PORT); | ||
|
||
var big = ''; | ||
for (var i = 0; i < COUNT; i++) | ||
big += 'GET / HTTP/1.0\r\n\r\n'; | ||
s.write(big); | ||
s.resume(); | ||
}); | ||
|
||
process.on('exit', function() { | ||
assert.equal(received, COUNT); | ||
}); |