summaryrefslogtreecommitdiff
path: root/src/node_http_parser_traditional.cc
diff options
context:
space:
mode:
authorAnna Henningsen <anna@addaleax.net>2018-11-30 07:39:02 +0100
committerDaniel Bevenius <daniel.bevenius@gmail.com>2018-12-06 05:21:36 +0100
commitaa943d098e0299ea87485a607353d152f5ea5012 (patch)
treeb3f2cd52efc4568d5f7deb6ca99684e2f5d22a62 /src/node_http_parser_traditional.cc
parent7bcbf044ddc864be9d6c711a75f3a33b6a3c652e (diff)
downloadandroid-node-v8-aa943d098e0299ea87485a607353d152f5ea5012.tar.gz
android-node-v8-aa943d098e0299ea87485a607353d152f5ea5012.tar.bz2
android-node-v8-aa943d098e0299ea87485a607353d152f5ea5012.zip
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 <joyeec9h3@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com> Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Matheus Marchini <mat@mmarchini.me> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Ali Ijaz Sheikh <ofrobots@google.com>
Diffstat (limited to 'src/node_http_parser_traditional.cc')
-rw-r--r--src/node_http_parser_traditional.cc18
1 files changed, 18 insertions, 0 deletions
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)