changed error handling to use int to properly detect codes

pull/2141/head
dan 1 year ago
parent abadb54272
commit bd2d874c33

@ -191,7 +191,7 @@ namespace llarp::quic
conn.base_cid,
ngtcp2_strerror(rv));
// close_connection(conn, rv, "ERR_PROTO"sv);
close_connection(conn, ngtcp2_err_infer_quic_transport_error_code(rv), "ERR_PROTO"sv);
close_connection(conn, rv, "ERR_PROTO"sv);
}
else if (rv == NGTCP2_ERR_DROP_CONN)
{
@ -263,7 +263,7 @@ namespace llarp::quic
}
void
Endpoint::close_connection(Connection& conn, uint64_t code, std::string_view close_reason)
Endpoint::close_connection(Connection& conn, int code, std::string_view close_reason)
{
log::debug(logcat, "Closing connection {}", conn.base_cid);

@ -196,7 +196,7 @@ namespace llarp::quic
// values.
void
close_connection(
Connection& conn, uint64_t code = NGTCP2_NO_ERROR, std::string_view close_reason = ""sv);
Connection& conn, int code = NGTCP2_NO_ERROR, std::string_view close_reason = ""sv);
/// Puts a connection into draining mode (i.e. after getting a connection close). This will
/// keep the connection registered for the recommended 3*Probe Timeout, during which we drop

Loading…
Cancel
Save