diff --git a/src/node_http_parser_llhttp.cc b/src/node_http_parser_llhttp.cc index 8728fa2b677403..423fb5e104bc50 100644 --- a/src/node_http_parser_llhttp.cc +++ b/src/node_http_parser_llhttp.cc @@ -1,16 +1,18 @@ #define NODE_EXPERIMENTAL_HTTP 1 #include "node_http_parser_impl.h" +#include "node_metadata.h" namespace node { +namespace per_process { const char* const llhttp_version = NODE_STRINGIFY(LLHTTP_VERSION_MAJOR) "." NODE_STRINGIFY(LLHTTP_VERSION_MINOR) "." NODE_STRINGIFY(LLHTTP_VERSION_PATCH); - +} // namespace per_process } // namespace node NODE_MODULE_CONTEXT_AWARE_INTERNAL(http_parser_llhttp, diff --git a/src/node_http_parser_traditional.cc b/src/node_http_parser_traditional.cc index 2ea452239a0a1d..89ef65979ca78b 100644 --- a/src/node_http_parser_traditional.cc +++ b/src/node_http_parser_traditional.cc @@ -3,16 +3,17 @@ #endif #include "node_http_parser_impl.h" +#include "node_metadata.h" namespace node { - +namespace per_process { const char* const http_parser_version = NODE_STRINGIFY(HTTP_PARSER_VERSION_MAJOR) "." NODE_STRINGIFY(HTTP_PARSER_VERSION_MINOR) "." NODE_STRINGIFY(HTTP_PARSER_VERSION_PATCH); - +} // namespace per_process } // namespace node NODE_MODULE_CONTEXT_AWARE_INTERNAL(http_parser, node::InitializeHttpParser) diff --git a/src/node_internals.h b/src/node_internals.h index 2c6aad5b967c3d..03017fb4f5185e 100644 --- a/src/node_internals.h +++ b/src/node_internals.h @@ -698,9 +698,6 @@ static inline const char* errno_string(int errorno) { extern double prog_start_time; -extern const char* const llhttp_version; -extern const char* const http_parser_version; - void Abort(const v8::FunctionCallbackInfo& args); void Chdir(const v8::FunctionCallbackInfo& args); void CPUUsage(const v8::FunctionCallbackInfo& args); diff --git a/src/node_metadata.cc b/src/node_metadata.cc index b851350958763d..1f86ebc5973fe7 100644 --- a/src/node_metadata.cc +++ b/src/node_metadata.cc @@ -3,7 +3,6 @@ #include "brotli/encode.h" #include "nghttp2/nghttp2ver.h" #include "node.h" -#include "node_internals.h" #include "util.h" #include "uv.h" #include "v8.h" @@ -45,8 +44,8 @@ Metadata::Versions::Versions() { modules = NODE_STRINGIFY(NODE_MODULE_VERSION); nghttp2 = NGHTTP2_VERSION; napi = NODE_STRINGIFY(NAPI_VERSION); - llhttp = llhttp_version; - http_parser = http_parser_version; + llhttp = per_process::llhttp_version; + http_parser = per_process::http_parser_version; brotli = std::to_string(BrotliEncoderVersion() >> 24) + diff --git a/src/node_metadata.h b/src/node_metadata.h index ca4a574008f81e..bf1a7cb9e07c20 100644 --- a/src/node_metadata.h +++ b/src/node_metadata.h @@ -45,6 +45,8 @@ class Metadata { // Per-process global namespace per_process { extern Metadata metadata; +extern const char* const llhttp_version; +extern const char* const http_parser_version; } } // namespace node