Skip to content

Commit e5b4af4

Browse files
joyeecheungaddaleax
authored andcommitted
src: move the declaration of http parser versions into node_metadata.h
Instead of putting them in node_internals.h. PR-URL: #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 64c713a commit e5b4af4

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
@@ -3,7 +3,6 @@
33
#include "brotli/encode.h"
44
#include "nghttp2/nghttp2ver.h"
55
#include "node.h"
6-
#include "node_internals.h"
76
#include "util.h"
87
#include "uv.h"
98
#include "v8.h"
@@ -45,8 +44,8 @@ Metadata::Versions::Versions() {
4544
modules = NODE_STRINGIFY(NODE_MODULE_VERSION);
4645
nghttp2 = NGHTTP2_VERSION;
4746
napi = NODE_STRINGIFY(NAPI_VERSION);
48-
llhttp = llhttp_version;
49-
http_parser = http_parser_version;
47+
llhttp = per_process::llhttp_version;
48+
http_parser = per_process::http_parser_version;
5049

5150
brotli =
5251
std::to_string(BrotliEncoderVersion() >> 24) +

src/node_metadata.h

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

5052
} // namespace node

0 commit comments

Comments
 (0)