mirror of
https://github.com/curl/curl.git
synced 2026-07-16 13:47:31 +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
|
|
@ -76,6 +76,17 @@ void Curl_bufq_skip(struct bufq *q, size_t amount);
|
|||
|
||||
This removes `amount` number of bytes from the `bufq`.
|
||||
|
||||
## unwrite
|
||||
|
||||
It is possible to undo writes by calling:
|
||||
|
||||
```
|
||||
CURLcode Curl_bufq_unwrite(struct bufq *q, size_t len);
|
||||
```
|
||||
|
||||
This will remove `len` bytes from the end of the bufq again. When removing
|
||||
more bytes than are present, CURLE_AGAIN is returned and the bufq will be
|
||||
empty.
|
||||
|
||||
## lifetime
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue