diff options
-rw-r--r-- | lib/vquic/ngtcp2.c | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/lib/vquic/ngtcp2.c b/lib/vquic/ngtcp2.c index 3ad8d08eb..3b5670616 100644 --- a/lib/vquic/ngtcp2.c +++ b/lib/vquic/ngtcp2.c @@ -906,12 +906,9 @@ static int ng_perform_getsock(const struct connectdata *conn, return ng_getsock((struct connectdata *)conn, socks); } -static CURLcode ng_disconnect(struct connectdata *conn, - bool dead_connection) +static CURLcode qs_disconnect(struct quicsocket *qs) { int i; - struct quicsocket *qs = &conn->hequic[0]; - (void)dead_connection; if(qs->qlogfd != -1) close(qs->qlogfd); if(qs->ssl) @@ -934,6 +931,13 @@ static CURLcode ng_disconnect(struct connectdata *conn, return CURLE_OK; } +static CURLcode ng_disconnect(struct connectdata *conn, + bool dead_connection) +{ + (void)dead_connection; + return qs_disconnect(&conn->hequic[0]); +} + static unsigned int ng_conncheck(struct connectdata *conn, unsigned int checks_to_perform) { @@ -1706,11 +1710,11 @@ CURLcode Curl_quic_is_connected(struct connectdata *conn, result = ng_process_ingress(conn, sockfd, qs); if(result) - return result; + goto error; result = ng_flush_egress(conn, sockfd, qs); if(result) - return result; + goto error; if(ngtcp2_conn_get_handshake_completed(qs->qconn)) { *done = TRUE; @@ -1718,6 +1722,10 @@ CURLcode Curl_quic_is_connected(struct connectdata *conn, } return result; + error: + (void)qs_disconnect(qs); + return result; + } static CURLcode ng_process_ingress(struct connectdata *conn, int sockfd, |