mirror of
https://github.com/curl/curl.git
synced 2025-04-12 16:20:35 +08:00
ngtcp2: adapt to the new pkt_info arguments
Guidance-by: Tatsuhiro Tsujikawa Closes #5864
This commit is contained in:
parent
f31b2e7cb8
commit
7691f68ba3
@ -1729,6 +1729,7 @@ static CURLcode ng_process_ingress(struct connectdata *conn, int sockfd,
|
||||
socklen_t remote_addrlen;
|
||||
ngtcp2_path path;
|
||||
ngtcp2_tstamp ts = timestamp();
|
||||
ngtcp2_pkt_info pi = { 0 };
|
||||
|
||||
for(;;) {
|
||||
remote_addrlen = sizeof(remote_addr);
|
||||
@ -1750,7 +1751,7 @@ static CURLcode ng_process_ingress(struct connectdata *conn, int sockfd,
|
||||
ngtcp2_addr_init(&path.remote, (struct sockaddr *)&remote_addr,
|
||||
remote_addrlen, NULL);
|
||||
|
||||
rv = ngtcp2_conn_read_pkt(qs->qconn, &path, buf, recvd, ts);
|
||||
rv = ngtcp2_conn_read_pkt(qs->qconn, &path, &pi, buf, recvd, ts);
|
||||
if(rv != 0) {
|
||||
/* TODO Send CONNECTION_CLOSE if possible */
|
||||
return CURLE_RECV_ERROR;
|
||||
@ -1815,7 +1816,7 @@ static CURLcode ng_flush_egress(struct connectdata *conn, int sockfd,
|
||||
uint32_t flags = NGTCP2_WRITE_STREAM_FLAG_MORE |
|
||||
(fin ? NGTCP2_WRITE_STREAM_FLAG_FIN : 0);
|
||||
outlen =
|
||||
ngtcp2_conn_writev_stream(qs->qconn, &ps.path,
|
||||
ngtcp2_conn_writev_stream(qs->qconn, &ps.path, NULL,
|
||||
out, pktlen, &ndatalen,
|
||||
flags, stream_id,
|
||||
(const ngtcp2_vec *)vec, veccnt, ts);
|
||||
@ -1860,7 +1861,8 @@ static CURLcode ng_flush_egress(struct connectdata *conn, int sockfd,
|
||||
}
|
||||
}
|
||||
if(outlen < 0) {
|
||||
outlen = ngtcp2_conn_write_pkt(qs->qconn, &ps.path, out, pktlen, ts);
|
||||
outlen = ngtcp2_conn_write_pkt(qs->qconn, &ps.path, NULL,
|
||||
out, pktlen, ts);
|
||||
if(outlen < 0) {
|
||||
failf(conn->data, "ngtcp2_conn_write_pkt returned error: %s\n",
|
||||
ngtcp2_strerror((int)outlen));
|
||||
|
Loading…
x
Reference in New Issue
Block a user