1
1
Fork 0
mirror of https://github.com/oxen-io/lokinet synced 2023-12-14 06:53:00 +01:00

changed error handling to use int to properly detect codes

This commit is contained in:
dan 2023-03-09 12:20:22 -08:00
parent abadb54272
commit bd2d874c33
2 changed files with 3 additions and 3 deletions

View file

@ -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);

View file

@ -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