Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions src/quic/data.cc
Original file line number Diff line number Diff line change
Expand Up @@ -149,15 +149,15 @@ T Store::convert() const {
}

Store::operator uv_buf_t() const {
return convert<uv_buf_t, typeof(*uv_buf_t::base)>();
return convert<uv_buf_t, char>();
}

Store::operator ngtcp2_vec() const {
return convert<ngtcp2_vec, typeof(*ngtcp2_vec::base)>();
return convert<ngtcp2_vec, uint8_t>();
}

Store::operator nghttp3_vec() const {
return convert<nghttp3_vec, typeof(*ngtcp2_vec::base)>();
return convert<nghttp3_vec, uint8_t>();
}

void Store::MemoryInfo(MemoryTracker* tracker) const {
Expand Down Expand Up @@ -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();
Expand Down
6 changes: 5 additions & 1 deletion src/quic/data.h
Original file line number Diff line number Diff line change
Expand Up @@ -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) \
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion test/cctest/test_quic_error.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down
Loading