@@ -73,8 +73,7 @@ namespace quic {
7373#define ENDPOINT_CC (V ) \
7474 V (RENO, reno) \
7575 V (CUBIC, cubic) \
76- V (BBR, bbr) \
77- V (BBR2, bbr2)
76+ V (BBR, bbr)
7877
7978struct Endpoint ::State {
8079#define V (_, name, type ) type name;
@@ -427,11 +426,15 @@ int Endpoint::UDP::Bind(const Endpoint::Options& options) {
427426}
428427
429428void Endpoint::UDP::Ref () {
430- if (!is_closed ()) uv_ref (reinterpret_cast <uv_handle_t *>(&impl_->handle_ ));
429+ if (!is_closed_or_closing ()) {
430+ uv_ref (reinterpret_cast <uv_handle_t *>(&impl_->handle_ ));
431+ }
431432}
432433
433434void Endpoint::UDP::Unref () {
434- if (!is_closed ()) uv_unref (reinterpret_cast <uv_handle_t *>(&impl_->handle_ ));
435+ if (!is_closed_or_closing ()) {
436+ uv_unref (reinterpret_cast <uv_handle_t *>(&impl_->handle_ ));
437+ }
435438}
436439
437440int Endpoint::UDP::Start () {
@@ -476,7 +479,7 @@ Endpoint::UDP::operator bool() const {
476479}
477480
478481SocketAddress Endpoint::UDP::local_address () const {
479- DCHECK (!is_closed () && is_bound ());
482+ DCHECK (!is_closed_or_closing () && is_bound ());
480483 return SocketAddress::FromSockName (impl_->handle_ );
481484}
482485
@@ -1012,7 +1015,7 @@ void Endpoint::Receive(const uv_buf_t& buf,
10121015
10131016 if (options_.validate_address ) {
10141017 // If there is no token, generate and send one.
1015- if (hd.token . len == 0 ) {
1018+ if (hd.tokenlen == 0 ) {
10161019 SendRetry (PathDescriptor{
10171020 version,
10181021 dcid,
@@ -1027,9 +1030,9 @@ void Endpoint::Receive(const uv_buf_t& buf,
10271030
10281031 // We have two kinds of tokens, each prefixed with a different magic
10291032 // byte.
1030- switch (hd.token . base [0 ]) {
1033+ switch (hd.token [0 ]) {
10311034 case RetryToken::kTokenMagic : {
1032- RetryToken token (hd.token . base , hd.token . len );
1035+ RetryToken token (hd.token , hd.tokenlen );
10331036 auto ocid = token.Validate (
10341037 version,
10351038 remote_address,
@@ -1055,7 +1058,7 @@ void Endpoint::Receive(const uv_buf_t& buf,
10551058 break ;
10561059 }
10571060 case RegularToken::kTokenMagic : {
1058- RegularToken token (hd.token . base , hd.token . len );
1061+ RegularToken token (hd.token , hd.tokenlen );
10591062 if (!token.Validate (
10601063 version,
10611064 remote_address,
@@ -1072,8 +1075,8 @@ void Endpoint::Receive(const uv_buf_t& buf,
10721075 // if a retry is sent.
10731076 return true ;
10741077 }
1075- hd.token . base = nullptr ;
1076- hd.token . len = 0 ;
1078+ hd.token = nullptr ;
1079+ hd.tokenlen = 0 ;
10771080 break ;
10781081 }
10791082 default : {
@@ -1093,7 +1096,7 @@ void Endpoint::Receive(const uv_buf_t& buf,
10931096 // so we don't have to do this dance again for this endpoint
10941097 // instance.
10951098 addrLRU_.Upsert (remote_address)->validated = true ;
1096- } else if (hd.token . len > 0 ) {
1099+ } else if (hd.tokenlen > 0 ) {
10971100 // If validation is turned off and there is a token, that's weird.
10981101 // The peer should only have a token if we sent it to them and we
10991102 // wouldn't have sent it unless validation was turned on. Let's
0 commit comments