Skip to content
This repository has been archived by the owner on Aug 11, 2020. It is now read-only.

Commit

Permalink
quic: stringify NGTCP2_ALPN_H3 constant
Browse files Browse the repository at this point in the history
Currently, the constant NGTCP2_ALPN_H3 is not being set correctly:

 AF_INET: 2,
 AF_INET6: 30,
 '\x05h3-24': '\x05h3-24'

This commit stringifies the constant name so that this becomes:

 AF_INET: 2,
 AF_INET6: 30,
 NGTCP2_ALPN_H3: '\x05h3-24'

This was causing the test-quic-binding.js test to fail.

PR-URL: #285
Reviewed-By: James M Snell <[email protected]>
  • Loading branch information
danbev authored and jasnell committed Jan 15, 2020
1 parent 75f3ff7 commit 14aed80
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/quic/node_quic.cc
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,9 @@ void Initialize(Local<Object> target,
NODE_DEFINE_CONSTANT(constants, NGTCP2_NO_ERROR);
NODE_DEFINE_CONSTANT(constants, AF_INET);
NODE_DEFINE_CONSTANT(constants, AF_INET6);
NODE_DEFINE_STRING_CONSTANT(constants, NGTCP2_ALPN_H3, NGTCP2_ALPN_H3);
NODE_DEFINE_STRING_CONSTANT(constants,
NODE_STRINGIFY_HELPER(NGTCP2_ALPN_H3),
NGTCP2_ALPN_H3);

target->Set(context, env->constants_string(), constants).FromJust();
}
Expand Down

0 comments on commit 14aed80

Please sign in to comment.