diff --git a/src/quic/data.cc b/src/quic/data.cc index d54e4c6af2236c..3a0f9bcff835fd 100644 --- a/src/quic/data.cc +++ b/src/quic/data.cc @@ -149,15 +149,15 @@ T Store::convert() const { } Store::operator uv_buf_t() const { - return convert(); + return convert(); } Store::operator ngtcp2_vec() const { - return convert(); + return convert(); } Store::operator nghttp3_vec() const { - return convert(); + return convert(); } void Store::MemoryInfo(MemoryTracker* tracker) const { @@ -386,6 +386,8 @@ const QuicError QuicError::FromConnectionClose(ngtcp2_conn* session) { QUIC_TRANSPORT_ERRORS(V) #undef V +const QuicError QuicError::TRANSPORT_NO_ERROR = + ForTransport(TransportError::NO_ERROR_); const QuicError QuicError::HTTP3_NO_ERROR = ForApplication(NGHTTP3_H3_NO_ERROR); const QuicError QuicError::VERSION_NEGOTIATION = ForVersionNegotiation(); const QuicError QuicError::IDLE_CLOSE = ForIdleClose(); diff --git a/src/quic/data.h b/src/quic/data.h index a63bc24b63eced..acd390c90ce339 100644 --- a/src/quic/data.h +++ b/src/quic/data.h @@ -108,7 +108,6 @@ class Store final : public MemoryRetainer { // Periodically, these need to be updated to match the latest ngtcp2 defs. #define QUIC_TRANSPORT_ERRORS(V) \ - V(NO_ERROR) \ V(INTERNAL_ERROR) \ V(CONNECTION_REFUSED) \ V(FLOW_CONTROL_ERROR) \ @@ -155,6 +154,10 @@ class QuicError final : public MemoryRetainer { public: // The known error codes for the transport namespace. enum class TransportError : error_code { + // NO_ERROR has to be treated specially since it is a macro on + // some Windows cases and results in a compile error if we leave + // it as is. + NO_ERROR_ = NGTCP2_NO_ERROR, #define V(name) name = NGTCP2_##name, QUIC_TRANSPORT_ERRORS(V) #undef V @@ -273,6 +276,7 @@ class QuicError final : public MemoryRetainer { static const QuicError FromConnectionClose(ngtcp2_conn* session); + static const QuicError TRANSPORT_NO_ERROR; #define V(name) static const QuicError TRANSPORT_##name; QUIC_TRANSPORT_ERRORS(V) #undef V diff --git a/test/cctest/test_quic_error.cc b/test/cctest/test_quic_error.cc index 04e3524ff611ac..b3677603c4a0d3 100644 --- a/test/cctest/test_quic_error.cc +++ b/test/cctest/test_quic_error.cc @@ -16,7 +16,7 @@ TEST(QuicError, NoError) { CHECK_EQ(err.reason(), ""); CHECK_EQ(err, QuicError::TRANSPORT_NO_ERROR); - CHECK_EQ(QuicError::TransportError::NO_ERROR, QuicError::QUIC_NO_ERROR); + CHECK_EQ(QuicError::TransportError::NO_ERROR_, QuicError::QUIC_NO_ERROR); CHECK_EQ(QuicError::Http3Error::H3_NO_ERROR, QuicError::HTTP3_NO_ERROR_CODE); QuicError err2("a reason");