@@ -63,6 +63,7 @@ namespace quic {
6363 V (DATAGRAM, datagram, uint8_t ) \
6464 V (SESSION_TICKET, session_ticket, uint8_t ) \
6565 V (CLOSING, closing, uint8_t ) \
66+ V (FINISH_CLOSING, finish_closing, uint8_t ) \
6667 V (GRACEFUL_CLOSE, graceful_close, uint8_t ) \
6768 V (SILENT_CLOSE, silent_close, uint8_t ) \
6869 V (STATELESS_RESET, stateless_reset, uint8_t ) \
@@ -1401,7 +1402,7 @@ bool Session::is_destroyed_or_closing() const {
14011402
14021403void Session::Close (CloseMethod method) {
14031404 if (is_destroyed ()) return ;
1404- auto & stats_ = impl_->stats_ ;
1405+ // auto& stats_ = impl_->stats_;
14051406
14061407 if (impl_->last_error_ ) {
14071408 Debug (this , " Closing with error: %s" , impl_->last_error_ );
@@ -1458,6 +1459,8 @@ void Session::Close(CloseMethod method) {
14581459}
14591460
14601461void Session::FinishClose () {
1462+ if (impl_->state_ ->finish_closing ) return ; // we were already called, avoids calling it twice
1463+ impl_->state_ ->finish_closing = 1 ;
14611464 // FinishClose() should be called only after, and as a result of, Close()
14621465 // being called first.
14631466 DCHECK (!is_destroyed ());
0 commit comments