From bd2d874c33ec09518557232328c483f73be7903a Mon Sep 17 00:00:00 2001 From: dan Date: Thu, 9 Mar 2023 12:20:22 -0800 Subject: [PATCH] changed error handling to use int to properly detect codes --- llarp/quic/endpoint.cpp | 4 ++-- llarp/quic/endpoint.hpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/llarp/quic/endpoint.cpp b/llarp/quic/endpoint.cpp index 0c6ecae01..4678e07db 100644 --- a/llarp/quic/endpoint.cpp +++ b/llarp/quic/endpoint.cpp @@ -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); diff --git a/llarp/quic/endpoint.hpp b/llarp/quic/endpoint.hpp index f09be532c..0e38ff374 100644 --- a/llarp/quic/endpoint.hpp +++ b/llarp/quic/endpoint.hpp @@ -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