Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit e5b4af4

Browse filesBrowse 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 <srloomis@us.ibm.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Minwoo Jung <minwoo@nodesource.com> Reviewed-By: James M Snell <jasnell@gmail.com>
1 parent 64c713a commit e5b4af4
Copy full SHA for e5b4af4

File tree

Expand file treeCollapse file tree

5 files changed

+10
-9
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

5 files changed

+10
-9
lines changed
Open diff view settings
Collapse file

‎src/node_http_parser_llhttp.cc‎

Copy file name to clipboardExpand all lines: src/node_http_parser_llhttp.cc
+3-1Lines changed: 3 additions & 1 deletion
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,
Collapse file

‎src/node_http_parser_traditional.cc‎

Copy file name to clipboardExpand all lines: src/node_http_parser_traditional.cc
+3-2Lines changed: 3 additions & 2 deletions
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)
Collapse file

‎src/node_internals.h‎

Copy file name to clipboardExpand all lines: src/node_internals.h
-3Lines changed: 0 additions & 3 deletions
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);
Collapse file

‎src/node_metadata.cc‎

Copy file name to clipboardExpand all lines: src/node_metadata.cc
+2-3Lines changed: 2 additions & 3 deletions
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) +
Collapse file

‎src/node_metadata.h‎

Copy file name to clipboardExpand all lines: src/node_metadata.h
+2Lines changed: 2 additions & 0 deletions
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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.