summaryrefslogtreecommitdiff
path: root/libs/libcurl/src/vquic
diff options
context:
space:
mode:
authordartraiden <wowemuh@gmail.com>2021-04-03 16:14:19 +0300
committerdartraiden <wowemuh@gmail.com>2021-04-03 16:14:19 +0300
commitf223275b6ca65c29f8f098818241150338e00123 (patch)
tree7cc89050956d82aab5ee33cf98f211f1840c28e6 /libs/libcurl/src/vquic
parent9a749bc628747c148394314a97fdeae6e032dc0b (diff)
libcurl: update to 7.76.0
Diffstat (limited to 'libs/libcurl/src/vquic')
-rw-r--r--libs/libcurl/src/vquic/ngtcp2.c25
-rw-r--r--libs/libcurl/src/vquic/quiche.c4
2 files changed, 16 insertions, 13 deletions
diff --git a/libs/libcurl/src/vquic/ngtcp2.c b/libs/libcurl/src/vquic/ngtcp2.c
index d4d0e8bf43..9569431ca2 100644
--- a/libs/libcurl/src/vquic/ngtcp2.c
+++ b/libs/libcurl/src/vquic/ngtcp2.c
@@ -580,7 +580,7 @@ static int cb_recv_stream_data(ngtcp2_conn *tconn, uint32_t flags,
{
struct quicsocket *qs = (struct quicsocket *)user_data;
ssize_t nconsumed;
- int fin = flags & NGTCP2_STREAM_DATA_FLAG_FIN ? 1 : 0;
+ int fin = (flags & NGTCP2_STREAM_DATA_FLAG_FIN) ? 1 : 0;
(void)offset;
(void)stream_user_data;
@@ -739,7 +739,10 @@ static ngtcp2_callbacks ng_callbacks = {
NULL, /* handshake_confirmed */
NULL, /* recv_new_token */
ngtcp2_crypto_delete_crypto_aead_ctx_cb,
- ngtcp2_crypto_delete_crypto_cipher_ctx_cb
+ ngtcp2_crypto_delete_crypto_cipher_ctx_cb,
+ NULL, /* recv_datagram */
+ NULL, /* ack_datagram */
+ NULL /* lost_datagram */
};
/*
@@ -758,7 +761,7 @@ CURLcode Curl_quic_connect(struct Curl_easy *data,
ngtcp2_path path; /* TODO: this must be initialized properly */
struct quicsocket *qs = &conn->hequic[sockindex];
char ipbuf[40];
- long port;
+ int port;
int qfd;
if(qs->conn)
@@ -773,7 +776,7 @@ CURLcode Curl_quic_connect(struct Curl_easy *data,
return CURLE_BAD_FUNCTION_ARGUMENT;
}
- infof(data, "Connect socket %d over QUIC to %s:%ld\n",
+ infof(data, "Connect socket %d over QUIC to %s:%d\n",
sockfd, ipbuf, port);
qs->version = NGTCP2_PROTO_VER_MAX;
@@ -807,8 +810,8 @@ CURLcode Curl_quic_connect(struct Curl_easy *data,
return CURLE_QUIC_CONNECT_ERROR;
ngtcp2_addr_init(&path.local, (struct sockaddr *)&qs->local_addr,
- qs->local_addrlen, NULL);
- ngtcp2_addr_init(&path.remote, addr, addrlen, NULL);
+ qs->local_addrlen);
+ ngtcp2_addr_init(&path.remote, addr, addrlen);
rc = ngtcp2_conn_client_new(&qs->qconn, &qs->dcid, &qs->scid, &path,
NGTCP2_PROTO_VER_MIN, &ng_callbacks,
@@ -827,7 +830,7 @@ CURLcode Curl_quic_connect(struct Curl_easy *data,
*/
int Curl_quic_ver(char *p, size_t len)
{
- ngtcp2_info *ng2 = ngtcp2_version(0);
+ const ngtcp2_info *ng2 = ngtcp2_version(0);
nghttp3_info *ht3 = nghttp3_version(0);
return msnprintf(p, len, "ngtcp2/%s nghttp3/%s",
ng2->version_str, ht3->version_str);
@@ -1291,7 +1294,6 @@ static int cb_h3_acked_stream_data(nghttp3_conn *conn, int64_t stream_id,
{
struct Curl_easy *data = stream_user_data;
struct HTTP *stream = data->req.p.http;
- int rv;
(void)user_data;
if(!data->set.postfields) {
@@ -1302,7 +1304,7 @@ static int cb_h3_acked_stream_data(nghttp3_conn *conn, int64_t stream_id,
DEBUGASSERT(stream->h3out->used < H3_SEND_SIZE);
if(stream->h3out->used == 0) {
- rv = nghttp3_conn_resume_stream(conn, stream_id);
+ int rv = nghttp3_conn_resume_stream(conn, stream_id);
if(rv != 0) {
return NGTCP2_ERR_CALLBACK_FAILURE;
}
@@ -1730,9 +1732,9 @@ static CURLcode ng_process_ingress(struct Curl_easy *data,
}
ngtcp2_addr_init(&path.local, (struct sockaddr *)&qs->local_addr,
- qs->local_addrlen, NULL);
+ qs->local_addrlen);
ngtcp2_addr_init(&path.remote, (struct sockaddr *)&remote_addr,
- remote_addrlen, NULL);
+ remote_addrlen);
rv = ngtcp2_conn_read_pkt(qs->qconn, &path, &pi, buf, recvd, ts);
if(rv != 0) {
@@ -1788,7 +1790,6 @@ static CURLcode ng_flush_egress(struct Curl_easy *data,
ngtcp2_path_storage_zero(&ps);
for(;;) {
- outlen = -1;
veccnt = 0;
stream_id = -1;
fin = 0;
diff --git a/libs/libcurl/src/vquic/quiche.c b/libs/libcurl/src/vquic/quiche.c
index d138dd3a24..a3870749b5 100644
--- a/libs/libcurl/src/vquic/quiche.c
+++ b/libs/libcurl/src/vquic/quiche.c
@@ -180,7 +180,7 @@ CURLcode Curl_quic_connect(struct Curl_easy *data,
struct quicsocket *qs = &conn->hequic[sockindex];
char *keylog_file = NULL;
char ipbuf[40];
- long port;
+ int port;
#ifdef DEBUG_QUICHE
/* initialize debug log callback only once */
@@ -360,6 +360,8 @@ static CURLcode process_ingress(struct Curl_easy *data, int sockfd,
uint8_t *buf = (uint8_t *)data->state.buffer;
size_t bufsize = data->set.buffer_size;
+ DEBUGASSERT(qs->conn);
+
/* in case the timeout expired */
quiche_conn_on_timeout(qs->conn);