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

Commit

Permalink
quic: add QuicSessionListener
Browse files Browse the repository at this point in the history
Fixes: #208
PR-URL: #207
Reviewed-By: #207
  • Loading branch information
jasnell committed Dec 4, 2019
1 parent 9206951 commit 603f151
Show file tree
Hide file tree
Showing 3 changed files with 643 additions and 330 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 @@ -553,19 +553,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 603f151

Please sign in to comment.