mirror of
https://github.com/curl/curl.git
synced 2026-07-24 12:17:16 +03:00
bufq: unwrite fix
`Curl_bufq_unwrite()` used the head instead of the tail chunk to shrink the bufq's content. Fix this and add test case that checks correct behaviour. Amended test 2601 accordingly. Reported-by: Chris Stubbs Closes #15136
This commit is contained in:
parent
08d13c0e46
commit
2400a6c6b2
4 changed files with 48 additions and 1 deletions
|
|
@ -491,7 +491,7 @@ CURLcode Curl_bufq_cwrite(struct bufq *q,
|
|||
CURLcode Curl_bufq_unwrite(struct bufq *q, size_t len)
|
||||
{
|
||||
while(len && q->tail) {
|
||||
len -= chunk_unwrite(q->head, len);
|
||||
len -= chunk_unwrite(q->tail, len);
|
||||
prune_tail(q);
|
||||
}
|
||||
return len ? CURLE_AGAIN : CURLE_OK;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue