Skip to content

Commit a29c93a

Browse files
committed
src: move the declaration of http parser versions into node_metadata.h
Instead of putting them in node_internals.h. PR-URL: nodejs#25115 Reviewed-By: Steven R Loomis <[email protected]> Reviewed-By: Richard Lau <[email protected]> Reviewed-By: Minwoo Jung <[email protected]> Reviewed-By: James M Snell <[email protected]>
1 parent e970361 commit a29c93a

5 files changed

+10
-9
lines changed

src/node_http_parser_llhttp.cc

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,18 @@
11
#define NODE_EXPERIMENTAL_HTTP 1
22

33
#include "node_http_parser_impl.h"
4+
#include "node_metadata.h"
45

56
namespace node {
67

8+
namespace per_process {
79
const char* const llhttp_version =
810
NODE_STRINGIFY(LLHTTP_VERSION_MAJOR)
911
"."
1012
NODE_STRINGIFY(LLHTTP_VERSION_MINOR)
1113
"."
1214
NODE_STRINGIFY(LLHTTP_VERSION_PATCH);
13-
15+
} // namespace per_process
1416
} // namespace node
1517

1618
NODE_MODULE_CONTEXT_AWARE_INTERNAL(http_parser_llhttp,

src/node_http_parser_traditional.cc

+3-2
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,17 @@
33
#endif
44

55
#include "node_http_parser_impl.h"
6+
#include "node_metadata.h"
67

78
namespace node {
8-
9+
namespace per_process {
910
const char* const http_parser_version =
1011
NODE_STRINGIFY(HTTP_PARSER_VERSION_MAJOR)
1112
"."
1213
NODE_STRINGIFY(HTTP_PARSER_VERSION_MINOR)
1314
"."
1415
NODE_STRINGIFY(HTTP_PARSER_VERSION_PATCH);
15-
16+
} // namespace per_process
1617
} // namespace node
1718

1819
NODE_MODULE_CONTEXT_AWARE_INTERNAL(http_parser, node::InitializeHttpParser)

src/node_internals.h

-3
Original file line numberDiff line numberDiff line change
@@ -698,9 +698,6 @@ static inline const char* errno_string(int errorno) {
698698

699699
extern double prog_start_time;
700700

701-
extern const char* const llhttp_version;
702-
extern const char* const http_parser_version;
703-
704701
void Abort(const v8::FunctionCallbackInfo<v8::Value>& args);
705702
void Chdir(const v8::FunctionCallbackInfo<v8::Value>& args);
706703
void CPUUsage(const v8::FunctionCallbackInfo<v8::Value>& args);

src/node_metadata.cc

+2-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
#include "ares.h"
33
#include "nghttp2/nghttp2ver.h"
44
#include "node.h"
5-
#include "node_internals.h"
65
#include "util.h"
76
#include "uv.h"
87
#include "v8.h"
@@ -44,8 +43,8 @@ Metadata::Versions::Versions() {
4443
modules = NODE_STRINGIFY(NODE_MODULE_VERSION);
4544
nghttp2 = NGHTTP2_VERSION;
4645
napi = NODE_STRINGIFY(NAPI_VERSION);
47-
llhttp = llhttp_version;
48-
http_parser = http_parser_version;
46+
llhttp = per_process::llhttp_version;
47+
http_parser = per_process::http_parser_version;
4948

5049
#if HAVE_OPENSSL
5150
openssl = GetOpenSSLVersion();

src/node_metadata.h

+2
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ class Metadata {
4444
// Per-process global
4545
namespace per_process {
4646
extern Metadata metadata;
47+
extern const char* const llhttp_version;
48+
extern const char* const http_parser_version;
4749
}
4850

4951
} // namespace node

0 commit comments

Comments
 (0)