http: remove legacy parser

Remove the legacy `http_parser` implementation as a dependency
and all code that uses it in favor of llhttp, given that the latter
has been the default for all of Node 12 with no outstanding issues.

PR-URL: https://github.com/nodejs/node/pull/29589
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Minwoo Jung <minwoo@nodesource.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
This commit is contained in:
Anna Henningsen 2019-09-17 14:17:08 +02:00
parent ba3be578d8
commit ac59dc42ed
No known key found for this signature in database
GPG key ID: 9C63F3A6CD2AD8F9
39 changed files with 99 additions and 8657 deletions

View file

@ -10,7 +10,6 @@ const { getOptionValue } = require('internal/options');
console.log('pid is', process.pid);
console.log('max header size is', getOptionValue('--max-http-header-size'));
console.log('current http parser is', getOptionValue('--http-parser'));
// Verify that we cannot receive more than 8KB of headers.
@ -33,12 +32,8 @@ function finished(client, callback) {
function fillHeaders(headers, currentSize, valid = false) {
// `llhttp` counts actual header name/value sizes, excluding the whitespace
// and stripped chars.
if (getOptionValue('--http-parser') === 'llhttp') {
// OK, Content-Length, 0, X-CRASH, aaa...
headers += 'a'.repeat(MAX - currentSize);
} else {
headers += 'a'.repeat(MAX - headers.length - 3);
}
// OK, Content-Length, 0, X-CRASH, aaa...
headers += 'a'.repeat(MAX - currentSize);
// Generate valid headers
if (valid) {