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 5d48011

Browse filesBrowse files
santigimenoRafaelGSS
authored andcommitted
src: print nghttp2 logs when using --debug-nghttp2
PR-URL: #45209 Reviewed-By: Richard Lau <rlau@redhat.com> Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
1 parent 8d7aa53 commit 5d48011
Copy full SHA for 5d48011

File tree

Expand file treeCollapse file tree

2 files changed

+13
-0
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

2 files changed

+13
-0
lines changed
Open diff view settings
Collapse file

‎node.gyp‎

Copy file name to clipboardExpand all lines: node.gyp
+3Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -859,6 +859,9 @@
859859
},
860860
],
861861
}],
862+
[ 'debug_nghttp2==1', {
863+
'defines': [ 'NODE_DEBUG_NGHTTP2=1' ]
864+
}],
862865
],
863866
'actions': [
864867
{
Collapse file

‎src/node_http2.cc‎

Copy file name to clipboardExpand all lines: src/node_http2.cc
+10Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3179,6 +3179,12 @@ void SetCallbackFunctions(const FunctionCallbackInfo<Value>& args) {
31793179
#undef SET_FUNCTION
31803180
}
31813181

3182+
#ifdef NODE_DEBUG_NGHTTP2
3183+
void NgHttp2Debug(const char* format, va_list args) {
3184+
vfprintf(stderr, format, args);
3185+
}
3186+
#endif
3187+
31823188
void Http2State::MemoryInfo(MemoryTracker* tracker) const {
31833189
tracker->TrackField("root_buffer", root_buffer);
31843190
}
@@ -3344,6 +3350,10 @@ void Initialize(Local<Object> target,
33443350
#undef V
33453351

33463352
target->Set(context, env->constants_string(), constants).Check();
3353+
3354+
#ifdef NODE_DEBUG_NGHTTP2
3355+
nghttp2_set_debug_vprintf_callback(NgHttp2Debug);
3356+
#endif
33473357
}
33483358
} // namespace http2
33493359
} // namespace node

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.