[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gnurl] 390/411: quiche: close the connection
From: |
gnunet |
Subject: |
[gnurl] 390/411: quiche: close the connection |
Date: |
Wed, 13 Jan 2021 01:23:25 +0100 |
This is an automated email from the git hooks/post-receive script.
nikita pushed a commit to branch master
in repository gnurl.
commit 26f682bcc40dd8e197af3f0e958b0bd070d0ec26
Author: Daniel Stenberg <daniel@haxx.se>
AuthorDate: Wed Nov 18 14:06:07 2020 +0100
quiche: close the connection
Reported-by: Junho Choi
Fixes #6213
Closes #6217
---
lib/vquic/quiche.c | 22 ++++++++++++++--------
lib/vquic/quiche.h | 1 +
2 files changed, 15 insertions(+), 8 deletions(-)
diff --git a/lib/vquic/quiche.c b/lib/vquic/quiche.c
index 3d9739663..d0d150e39 100644
--- a/lib/vquic/quiche.c
+++ b/lib/vquic/quiche.c
@@ -89,8 +89,17 @@ static int quiche_perform_getsock(const struct connectdata
*conn,
return quiche_getsock((struct connectdata *)conn, socks);
}
-static CURLcode qs_disconnect(struct quicsocket *qs)
+static CURLcode qs_disconnect(struct connectdata *conn,
+ struct quicsocket *qs)
{
+ if(qs->conn) {
+ (void)quiche_conn_close(qs->conn, TRUE, 0, NULL, 0);
+ /* flushing the egress is not a failsafe way to deliver all the
+ outstanding packets, but we also don't want to get stuck here... */
+ (void)flush_egress(conn, qs->sockfd, qs);
+ quiche_conn_free(qs->conn);
+ qs->conn = NULL;
+ }
if(qs->h3config)
quiche_h3_config_free(qs->h3config);
if(qs->h3c)
@@ -99,10 +108,6 @@ static CURLcode qs_disconnect(struct quicsocket *qs)
quiche_config_free(qs->cfg);
qs->cfg = NULL;
}
- if(qs->conn) {
- quiche_conn_free(qs->conn);
- qs->conn = NULL;
- }
return CURLE_OK;
}
@@ -111,14 +116,14 @@ static CURLcode quiche_disconnect(struct connectdata
*conn,
{
struct quicsocket *qs = conn->quic;
(void)dead_connection;
- return qs_disconnect(qs);
+ return qs_disconnect(conn, qs);
}
void Curl_quic_disconnect(struct connectdata *conn,
int tempindex)
{
if(conn->transport == TRNSPRT_QUIC)
- qs_disconnect(&conn->hequic[tempindex]);
+ qs_disconnect(conn, &conn->hequic[tempindex]);
}
static unsigned int quiche_conncheck(struct connectdata *conn,
@@ -187,6 +192,7 @@ CURLcode Curl_quic_connect(struct connectdata *conn,
curl_socket_t sockfd,
(void)addr;
(void)addrlen;
+ qs->sockfd = sockfd;
qs->cfg = quiche_config_new(QUICHE_PROTOCOL_VERSION);
if(!qs->cfg) {
failf(data, "can't create quiche config");
@@ -337,7 +343,7 @@ CURLcode Curl_quic_is_connected(struct connectdata *conn,
int sockindex,
return result;
error:
- qs_disconnect(qs);
+ qs_disconnect(conn, qs);
return result;
}
diff --git a/lib/vquic/quiche.h b/lib/vquic/quiche.h
index 247c1c448..d311e9988 100644
--- a/lib/vquic/quiche.h
+++ b/lib/vquic/quiche.h
@@ -41,6 +41,7 @@ struct quicsocket {
quiche_h3_conn *h3c;
quiche_h3_config *h3config;
uint8_t scid[QUICHE_MAX_CONN_ID_LEN];
+ curl_socket_t sockfd;
uint32_t version;
};
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
- [gnurl] 365/411: winbuild: remove docs from Makefiles and refer to README.md, (continued)
- [gnurl] 365/411: winbuild: remove docs from Makefiles and refer to README.md, gnunet, 2021/01/12
- [gnurl] 343/411: tests/*server.py: close log file after each log line, gnunet, 2021/01/12
- [gnurl] 307/411: travis: use ninja-build for CMake builds, gnunet, 2021/01/12
- [gnurl] 287/411: tests: fix some http/2 tests for older versions of nghttpx, gnunet, 2021/01/12
- [gnurl] 408/411: gnurl adjustments (paths), gnunet, 2021/01/12
- [gnurl] 405/411: urldata: restore comment on ssl_connect_data.use, gnunet, 2021/01/12
- [gnurl] 396/411: scripts/completion.pl: parse all opts, gnunet, 2021/01/12
- [gnurl] 388/411: cmake: check for linux/tcp.h, gnunet, 2021/01/12
- [gnurl] 401/411: ftp: make wc_statemach loop instead of recurse, gnunet, 2021/01/12
- [gnurl] 395/411: RELEASE-NOTES: synced, gnunet, 2021/01/12
- [gnurl] 390/411: quiche: close the connection,
gnunet <=
- [gnurl] 404/411: VERSIONS: refreshed, gnunet, 2021/01/12
- [gnurl] 402/411: openssl: make the OCSP verification verify the certificate id, gnunet, 2021/01/12
- [gnurl] 400/411: ftp: CURLOPT_FTP_SKIP_PASV_IP by default, gnunet, 2021/01/12
- [gnurl] 407/411: Merge tag 'curl-7_74_0', gnunet, 2021/01/12
- [gnurl] 381/411: tests/server/tftpd.c: close upload file in case of abort, gnunet, 2021/01/12
- [gnurl] 389/411: ngtcp2: Fix build error due to symbol name change, gnunet, 2021/01/12
- [gnurl] 281/411: curl.1: add an "OUTPUT" section at the top of the manpage, gnunet, 2021/01/12