parent
5627033344
commit
5595e33617
22
lib/bufq.c
22
lib/bufq.c
@ -144,21 +144,6 @@ static size_t chunk_skip(struct buf_chunk *chunk, size_t amount)
|
||||
return n;
|
||||
}
|
||||
|
||||
static void chunk_shift(struct buf_chunk *chunk)
|
||||
{
|
||||
if(chunk->r_offset) {
|
||||
if(!chunk_is_empty(chunk)) {
|
||||
size_t n = chunk->w_offset - chunk->r_offset;
|
||||
memmove(chunk->x.data, chunk->x.data + chunk->r_offset, n);
|
||||
chunk->w_offset -= chunk->r_offset;
|
||||
chunk->r_offset = 0;
|
||||
}
|
||||
else {
|
||||
chunk->r_offset = chunk->w_offset = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void chunk_list_free(struct buf_chunk **anchor)
|
||||
{
|
||||
struct buf_chunk *chunk;
|
||||
@ -504,13 +489,6 @@ void Curl_bufq_skip(struct bufq *q, size_t amount)
|
||||
}
|
||||
}
|
||||
|
||||
void Curl_bufq_skip_and_shift(struct bufq *q, size_t amount)
|
||||
{
|
||||
Curl_bufq_skip(q, amount);
|
||||
if(q->tail)
|
||||
chunk_shift(q->tail);
|
||||
}
|
||||
|
||||
ssize_t Curl_bufq_pass(struct bufq *q, Curl_bufq_writer *writer,
|
||||
void *writer_ctx, CURLcode *err)
|
||||
{
|
||||
|
||||
@ -209,12 +209,6 @@ bool Curl_bufq_peek_at(struct bufq *q, size_t offset,
|
||||
*/
|
||||
void Curl_bufq_skip(struct bufq *q, size_t amount);
|
||||
|
||||
/**
|
||||
* Same as `skip` but shift tail data to the start afterwards,
|
||||
* so that further writes will find room in tail.
|
||||
*/
|
||||
void Curl_bufq_skip_and_shift(struct bufq *q, size_t amount);
|
||||
|
||||
typedef ssize_t Curl_bufq_writer(void *writer_ctx,
|
||||
const unsigned char *buf, size_t len,
|
||||
CURLcode *err);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user