Skip to content

Commit

Permalink
src: move the declaration of http parser versions into node_metadata.h
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
joyeecheung authored and addaleax committed Jan 14, 2019
1 parent 64c713a commit e5b4af4
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 9 deletions.
4 changes: 3 additions & 1 deletion src/node_http_parser_llhttp.cc
Original file line number Diff line number Diff line change
@@ -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,
Expand Down
5 changes: 3 additions & 2 deletions src/node_http_parser_traditional.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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)
3 changes: 0 additions & 3 deletions src/node_internals.h
Original file line number Diff line number Diff line change
Expand Up @@ -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<v8::Value>& args);
void Chdir(const v8::FunctionCallbackInfo<v8::Value>& args);
void CPUUsage(const v8::FunctionCallbackInfo<v8::Value>& args);
Expand Down
5 changes: 2 additions & 3 deletions src/node_metadata.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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) +
Expand Down
2 changes: 2 additions & 0 deletions src/node_metadata.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit e5b4af4

Please sign in to comment.