Skip to content

Commit

Permalink
quic: add QuicSessionListener
Browse files Browse the repository at this point in the history
Fixes: nodejs#208
  • Loading branch information
jasnell committed Dec 3, 2019
1 parent f8ec0ab commit 16932e3
Show file tree
Hide file tree
Showing 3 changed files with 639 additions and 319 deletions.
14 changes: 1 addition & 13 deletions src/node_quic_http3_application.cc
Original file line number Diff line number Diff line change
Expand Up @@ -521,19 +521,7 @@ void Http3Application::H3AckedStreamData(
void Http3Application::H3StreamClose(
int64_t stream_id,
uint64_t app_error_code) {
Environment* env = Session()->env();
Local<Value> argv[] = {
Number::New(env->isolate(), static_cast<double>(stream_id)),
Number::New(env->isolate(), static_cast<double>(app_error_code))
};

// Grab a shared pointer to this to prevent the QuicSession
// from being freed while the MakeCallback is running.
BaseObjectPtr<QuicSession> ptr(Session());
Session()->MakeCallback(
env->quic_on_stream_close_function(),
arraysize(argv),
argv);
Session()->Listener()->OnStreamClose(stream_id, app_error_code);
}

QuicStream* Http3Application::FindOrCreateStream(int64_t stream_id) {
Expand Down
Loading

0 comments on commit 16932e3

Please sign in to comment.