@@ -1818,7 +1818,7 @@ bool Session::is_server() const {
18181818}
18191819
18201820bool Session::is_destroyed () const {
1821- return !impl_ || destroy_deferred_ ;
1821+ return !impl_ || flags_. destroy_deferred ;
18221822}
18231823
18241824bool Session::is_destroyed_or_closing () const {
@@ -1996,9 +1996,9 @@ void Session::Destroy() {
19961996 // destroy impl_ now because the callback is executing methods on
19971997 // objects owned by impl_ (e.g., the Application). Defer the
19981998 // destruction until the scope exits.
1999- if (in_ngtcp2_callback_scope_ || in_nghttp3_callback_scope_ ) {
1999+ if (flags_. in_ngtcp2_callback_scope || flags_. in_nghttp3_callback_scope ) {
20002000 Debug (this , " Session destroy deferred (in callback scope)" );
2001- destroy_deferred_ = true ;
2001+ flags_. destroy_deferred = true ;
20022002 return ;
20032003 }
20042004
@@ -2139,8 +2139,8 @@ void Session::EmitQlog(uint32_t flags, std::string_view data) {
21392139 if (is_destroyed ()) {
21402140 auto isolate = env ()->isolate ();
21412141 Global<Object> recv (isolate, object ());
2142- Global<Function> cb (
2143- isolate, BindingData::Get (env ()).session_qlog_callback ());
2142+ Global<Function> cb (isolate,
2143+ BindingData::Get (env ()).session_qlog_callback ());
21442144 std::string buf (data);
21452145 env ()->SetImmediate ([recv = std::move (recv),
21462146 cb = std::move (cb),
@@ -2389,7 +2389,7 @@ void Session::SendBatch(Packet::Ptr* packets,
23892389 if (primary_count == 0 ) return ;
23902390
23912391 // Use batched send for the primary endpoint.
2392- if (prefer_try_send_ ) {
2392+ if (flags_. prefer_try_send ) {
23932393 endpoint ().SendBatch (primary_packets, primary_count);
23942394 } else {
23952395 // Non-flush path: send individually via async uv_udp_send.
@@ -2404,9 +2404,9 @@ void Session::FlushPendingData() {
24042404 if (impl_->application_ ) {
24052405 // Prefer synchronous sends during the deferred flush to avoid the
24062406 // one-tick latency of async uv_udp_send from the uv_check callback.
2407- prefer_try_send_ = true ;
2407+ flags_. prefer_try_send = true ;
24082408 application ().SendPendingData ();
2409- prefer_try_send_ = false ;
2409+ flags_. prefer_try_send = false ;
24102410 }
24112411}
24122412
@@ -2430,7 +2430,7 @@ void Session::Send(Packet::Ptr packet) {
24302430 // prefer synchronous send to avoid the one-tick latency of async
24312431 // uv_udp_send. SendOrTrySend uses uv_udp_try_send first, falling
24322432 // back to uv_udp_send on EAGAIN.
2433- if (prefer_try_send_ ) {
2433+ if (flags_. prefer_try_send ) {
24342434 Debug (this , " Session is sending (try_send) %s" , packet->ToString ());
24352435 endpoint ().SendOrTrySend (std::move (packet));
24362436 return ;
@@ -2865,7 +2865,7 @@ bool Session::can_send_packets() const {
28652865 // or closing period. The callback scope check is per-session so that
28662866 // one session's ngtcp2 callback does not block unrelated sessions
28672867 // from sending.
2868- return !is_destroyed () && !in_ngtcp2_callback_scope_ &&
2868+ return !is_destroyed () && !flags_. in_ngtcp2_callback_scope &&
28692869 !is_in_draining_period () && !is_in_closing_period ();
28702870}
28712871
0 commit comments