From a0d4cd119e43a17fc3ba4692814cc3942e9fa07e Mon Sep 17 00:00:00 2001 From: Matteo Collina Date: Sat, 1 Dec 2018 12:48:04 +0100 Subject: [PATCH 1/2] Make HTTP_MAX_HEADER_SIZE configurable via gyp --- http_parser.gyp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/http_parser.gyp b/http_parser.gyp index ef34ecae..34618a4c 100644 --- a/http_parser.gyp +++ b/http_parser.gyp @@ -47,6 +47,10 @@ ], }, + 'variables': { + 'http_max_header_size%': '8192' + }, + 'targets': [ { 'target_name': 'http_parser', @@ -56,7 +60,7 @@ 'defines': [ 'HTTP_PARSER_STRICT=0' ], 'include_dirs': [ '.' ], }, - 'defines': [ 'HTTP_PARSER_STRICT=0' ], + 'defines': [ 'HTTP_MAX_HEADER_SIZE=<(http_max_header_size)', 'HTTP_PARSER_STRICT=0' ], 'sources': [ './http_parser.c', ], 'conditions': [ ['OS=="win"', { @@ -79,7 +83,7 @@ 'defines': [ 'HTTP_PARSER_STRICT=1' ], 'include_dirs': [ '.' ], }, - 'defines': [ 'HTTP_PARSER_STRICT=1' ], + 'defines': [ 'HTTP_MAX_HEADER_SIZE=<(http_max_header_size)', 'HTTP_PARSER_STRICT=1' ], 'sources': [ './http_parser.c', ], 'conditions': [ ['OS=="win"', { From 1ee68c071c331d56f8552a5ab94fb68d62bb0fcf Mon Sep 17 00:00:00 2001 From: Matteo Collina Date: Mon, 3 Dec 2018 10:03:01 +0100 Subject: [PATCH 2/2] style nit --- http_parser.gyp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/http_parser.gyp b/http_parser.gyp index 34618a4c..4d061d6b 100644 --- a/http_parser.gyp +++ b/http_parser.gyp @@ -60,7 +60,10 @@ 'defines': [ 'HTTP_PARSER_STRICT=0' ], 'include_dirs': [ '.' ], }, - 'defines': [ 'HTTP_MAX_HEADER_SIZE=<(http_max_header_size)', 'HTTP_PARSER_STRICT=0' ], + 'defines': [ + 'HTTP_MAX_HEADER_SIZE=<(http_max_header_size)', + 'HTTP_PARSER_STRICT=0' + ], 'sources': [ './http_parser.c', ], 'conditions': [ ['OS=="win"', { @@ -83,7 +86,10 @@ 'defines': [ 'HTTP_PARSER_STRICT=1' ], 'include_dirs': [ '.' ], }, - 'defines': [ 'HTTP_MAX_HEADER_SIZE=<(http_max_header_size)', 'HTTP_PARSER_STRICT=1' ], + 'defines': [ + 'HTTP_MAX_HEADER_SIZE=<(http_max_header_size)', + 'HTTP_PARSER_STRICT=1' + ], 'sources': [ './http_parser.c', ], 'conditions': [ ['OS=="win"', {