Skip to content
Permalink
Browse files

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>
  • Loading branch information...
joyeecheung authored and addaleax committed Dec 18, 2018
1 parent 64c713a commit e5b4af43fd60c069f6323d115172133c0df6c9fb
Showing with 10 additions and 9 deletions.
  1. +3 −1 src/node_http_parser_llhttp.cc
  2. +3 −2 src/node_http_parser_traditional.cc
  3. +0 −3 src/node_internals.h
  4. +2 −3 src/node_metadata.cc
  5. +2 −0 src/node_metadata.h
@@ -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,
@@ -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)
@@ -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);
@@ -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) +
@@ -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

0 comments on commit e5b4af4

Please sign in to comment.
You can’t perform that action at this time.