@@ -1810,7 +1810,7 @@ bool Session::is_server() const {
18101810}
18111811
18121812bool Session::is_destroyed () const {
1813- return !impl_ || destroy_deferred_ ;
1813+ return !impl_ || flags_. destroy_deferred ;
18141814}
18151815
18161816bool Session::is_destroyed_or_closing () const {
@@ -1988,9 +1988,9 @@ void Session::Destroy() {
19881988 // destroy impl_ now because the callback is executing methods on
19891989 // objects owned by impl_ (e.g., the Application). Defer the
19901990 // destruction until the scope exits.
1991- if (in_ngtcp2_callback_scope_ || in_nghttp3_callback_scope_ ) {
1991+ if (flags_. in_ngtcp2_callback_scope || flags_. in_nghttp3_callback_scope ) {
19921992 Debug (this , " Session destroy deferred (in callback scope)" );
1993- destroy_deferred_ = true ;
1993+ flags_. destroy_deferred = true ;
19941994 return ;
19951995 }
19961996
@@ -2131,8 +2131,8 @@ void Session::EmitQlog(uint32_t flags, std::string_view data) {
21312131 if (is_destroyed ()) {
21322132 auto isolate = env ()->isolate ();
21332133 Global<Object> recv (isolate, object ());
2134- Global<Function> cb (
2135- isolate, BindingData::Get (env ()).session_qlog_callback ());
2134+ Global<Function> cb (isolate,
2135+ BindingData::Get (env ()).session_qlog_callback ());
21362136 std::string buf (data);
21372137 env ()->SetImmediate ([recv = std::move (recv),
21382138 cb = std::move (cb),
@@ -2381,7 +2381,7 @@ void Session::SendBatch(Packet::Ptr* packets,
23812381 if (primary_count == 0 ) return ;
23822382
23832383 // Use batched send for the primary endpoint.
2384- if (prefer_try_send_ ) {
2384+ if (flags_. prefer_try_send ) {
23852385 endpoint ().SendBatch (primary_packets, primary_count);
23862386 } else {
23872387 // Non-flush path: send individually via async uv_udp_send.
@@ -2396,9 +2396,9 @@ void Session::FlushPendingData() {
23962396 if (impl_->application_ ) {
23972397 // Prefer synchronous sends during the deferred flush to avoid the
23982398 // one-tick latency of async uv_udp_send from the uv_check callback.
2399- prefer_try_send_ = true ;
2399+ flags_. prefer_try_send = true ;
24002400 application ().SendPendingData ();
2401- prefer_try_send_ = false ;
2401+ flags_. prefer_try_send = false ;
24022402 }
24032403}
24042404
@@ -2422,7 +2422,7 @@ void Session::Send(Packet::Ptr packet) {
24222422 // prefer synchronous send to avoid the one-tick latency of async
24232423 // uv_udp_send. SendOrTrySend uses uv_udp_try_send first, falling
24242424 // back to uv_udp_send on EAGAIN.
2425- if (prefer_try_send_ ) {
2425+ if (flags_. prefer_try_send ) {
24262426 Debug (this , " Session is sending (try_send) %s" , packet->ToString ());
24272427 endpoint ().SendOrTrySend (std::move (packet));
24282428 return ;
@@ -2857,7 +2857,7 @@ bool Session::can_send_packets() const {
28572857 // or closing period. The callback scope check is per-session so that
28582858 // one session's ngtcp2 callback does not block unrelated sessions
28592859 // from sending.
2860- return !is_destroyed () && !in_ngtcp2_callback_scope_ &&
2860+ return !is_destroyed () && !flags_. in_ngtcp2_callback_scope &&
28612861 !is_in_draining_period () && !is_in_closing_period ();
28622862}
28632863
0 commit comments