Skip to content

Commit

Permalink
quic: hopefully temporary fallback to vfprintf
Browse files Browse the repository at this point in the history
Debug() is asserting when using a va_list
  • Loading branch information
jasnell committed Feb 25, 2020
1 parent 0890711 commit 547876a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/quic/node_quic_session.cc
Expand Up @@ -66,11 +66,14 @@ void SetConfig(Environment* env, int idx, uint64_t* val) {
// the NODE_DEBUG_NATIVE=NGTCP2_DEBUG category.
void Ngtcp2DebugLog(void* user_data, const char* fmt, ...) {
QuicSession* session = static_cast<QuicSession*>(user_data);
if (!UNLIKELY(session->env()->debug_enabled(DebugCategory::NGTCP2_DEBUG)))
return;
va_list ap;
va_start(ap, fmt);
std::string format(fmt, strlen(fmt) + 1);
format[strlen(fmt)] = '\n';
Debug(session->env(), DebugCategory::NGTCP2_DEBUG, format, ap);
// TODO(@jasnell): Debug() currently is not working with va_list here.
vfprintf(stderr, format.c_str(), ap);
va_end(ap);
}

Expand Down

0 comments on commit 547876a

Please sign in to comment.