mirror of
https://github.com/curl/curl.git
synced 2025-03-07 15:27:17 +08:00
ngtcp2: proper handling of uint64_t when adjusting send buffer
Fixes #11149 Closes #11153
This commit is contained in:
parent
e0ddfc8e05
commit
7ab94d7d57
@ -1438,6 +1438,7 @@ static int cb_h3_acked_req_body(nghttp3_conn *conn, int64_t stream_id,
|
||||
struct Curl_cfilter *cf = user_data;
|
||||
struct Curl_easy *data = stream_user_data;
|
||||
struct stream_ctx *stream = H3_STREAM_CTX(data);
|
||||
size_t skiplen;
|
||||
|
||||
(void)cf;
|
||||
if(!stream)
|
||||
@ -1445,9 +1446,12 @@ static int cb_h3_acked_req_body(nghttp3_conn *conn, int64_t stream_id,
|
||||
/* The server ackknowledged `datalen` of bytes from our request body.
|
||||
* This is a delta. We have kept this data in `sendbuf` for
|
||||
* re-transmissions and can free it now. */
|
||||
Curl_bufq_skip(&stream->sendbuf, datalen);
|
||||
DEBUGASSERT(stream->sendbuf_len_in_flight >= datalen);
|
||||
stream->sendbuf_len_in_flight -= datalen;
|
||||
if(datalen >= (uint64_t)stream->sendbuf_len_in_flight)
|
||||
skiplen = stream->sendbuf_len_in_flight;
|
||||
else
|
||||
skiplen = (size_t)datalen;
|
||||
Curl_bufq_skip(&stream->sendbuf, skiplen);
|
||||
stream->sendbuf_len_in_flight -= skiplen;
|
||||
|
||||
/* `sendbuf` *might* now have more room. If so, resume this
|
||||
* possibly paused stream. And also tell our transfer engine that
|
||||
|
Loading…
Reference in New Issue
Block a user