From aa943d098e0299ea87485a607353d152f5ea5012 Mon Sep 17 00:00:00 2001 From: Anna Henningsen Date: Fri, 30 Nov 2018 07:39:02 +0100 Subject: http: make parser choice a runtime flag Add a `--http-parser=llhttp` vs `--http-parser=traditional` command line switch, to make testing and comparing the new llhttp-based implementation easier. PR-URL: https://github.com/nodejs/node/pull/24739 Refs: https://github.com/nodejs/node/issues/24730 Reviewed-By: Joyee Cheung Reviewed-By: Colin Ihrig Reviewed-By: Fedor Indutny Reviewed-By: Gus Caplan Reviewed-By: Matheus Marchini Reviewed-By: Matteo Collina Reviewed-By: Ali Ijaz Sheikh --- src/node_http_parser_traditional.cc | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 src/node_http_parser_traditional.cc (limited to 'src/node_http_parser_traditional.cc') diff --git a/src/node_http_parser_traditional.cc b/src/node_http_parser_traditional.cc new file mode 100644 index 0000000000..2bff20c165 --- /dev/null +++ b/src/node_http_parser_traditional.cc @@ -0,0 +1,18 @@ +#ifdef NODE_EXPERIMENTAL_HTTP +#undef NODE_EXPERIMENTAL_HTTP +#endif + +#include "node_http_parser_impl.h" + +namespace node { + +const char* http_parser_version = + NODE_STRINGIFY(HTTP_PARSER_VERSION_MAJOR) + "." + NODE_STRINGIFY(HTTP_PARSER_VERSION_MINOR) + "." + NODE_STRINGIFY(HTTP_PARSER_VERSION_PATCH); + +} // namespace node + +NODE_MODULE_CONTEXT_AWARE_INTERNAL(http_parser, node::InitializeHttpParser) -- cgit v1.2.3