1
0
mirror of https://github.com/moparisthebest/curl synced 2024-08-13 17:03:50 -04:00

ngtcp2: adjust to recent sockaddr updates

Closes #5690
This commit is contained in:
Daniel Stenberg 2020-07-16 21:00:25 +02:00
parent d5814c0af0
commit da3e0f406a
No known key found for this signature in database
GPG Key ID: 5CC908FDB71E12C2
2 changed files with 7 additions and 9 deletions

View File

@ -828,9 +828,8 @@ CURLcode Curl_quic_connect(struct connectdata *conn,
if(rv == -1) if(rv == -1)
return CURLE_QUIC_CONNECT_ERROR; return CURLE_QUIC_CONNECT_ERROR;
ngtcp2_addr_init(&path.local, (uint8_t *)&qs->local_addr, qs->local_addrlen, ngtcp2_addr_init(&path.local, &qs->local_addr, qs->local_addrlen, NULL);
NULL); ngtcp2_addr_init(&path.remote, addr, addrlen, NULL);
ngtcp2_addr_init(&path.remote, (uint8_t*)addr, addrlen, NULL);
#ifdef NGTCP2_PROTO_VER #ifdef NGTCP2_PROTO_VER
#define QUICVER NGTCP2_PROTO_VER #define QUICVER NGTCP2_PROTO_VER
@ -1726,7 +1725,7 @@ static CURLcode ng_process_ingress(struct connectdata *conn, int sockfd,
int rv; int rv;
uint8_t buf[65536]; uint8_t buf[65536];
size_t bufsize = sizeof(buf); size_t bufsize = sizeof(buf);
struct sockaddr_storage remote_addr; struct sockaddr remote_addr;
socklen_t remote_addrlen; socklen_t remote_addrlen;
ngtcp2_path path; ngtcp2_path path;
ngtcp2_tstamp ts = timestamp(); ngtcp2_tstamp ts = timestamp();
@ -1746,10 +1745,9 @@ static CURLcode ng_process_ingress(struct connectdata *conn, int sockfd,
return CURLE_RECV_ERROR; return CURLE_RECV_ERROR;
} }
ngtcp2_addr_init(&path.local, (uint8_t *)&qs->local_addr, ngtcp2_addr_init(&path.local, &qs->local_addr,
qs->local_addrlen, NULL); qs->local_addrlen, NULL);
ngtcp2_addr_init(&path.remote, (uint8_t *)&remote_addr, remote_addrlen, ngtcp2_addr_init(&path.remote, &remote_addr, remote_addrlen, NULL);
NULL);
rv = ngtcp2_conn_read_pkt(qs->qconn, &path, buf, recvd, ts); rv = ngtcp2_conn_read_pkt(qs->qconn, &path, buf, recvd, ts);
if(rv != 0) { if(rv != 0) {
@ -1780,7 +1778,7 @@ static CURLcode ng_flush_egress(struct connectdata *conn, int sockfd,
nghttp3_vec vec[16]; nghttp3_vec vec[16];
ssize_t ndatalen; ssize_t ndatalen;
switch(qs->local_addr.ss_family) { switch(qs->local_addr.sa_family) {
case AF_INET: case AF_INET:
pktlen = NGTCP2_MAX_PKTLEN_IPV4; pktlen = NGTCP2_MAX_PKTLEN_IPV4;
break; break;

View File

@ -58,7 +58,7 @@ struct quicsocket {
struct quic_handshake crypto_data[3]; struct quic_handshake crypto_data[3];
/* the last TLS alert description generated by the local endpoint */ /* the last TLS alert description generated by the local endpoint */
uint8_t tls_alert; uint8_t tls_alert;
struct sockaddr_storage local_addr; struct sockaddr local_addr;
socklen_t local_addrlen; socklen_t local_addrlen;
nghttp3_conn *h3conn; nghttp3_conn *h3conn;