mirror of
https://github.com/nginx/nginx.git
synced 2026-10-21 19:41:35 +00:00
QUIC: removed ngx_quic_copy_chain().
The function is unused.
This commit is contained in:
parent
4d79f94221
commit
703be8c8f6
2 changed files with 0 additions and 61 deletions
|
|
@ -430,65 +430,6 @@ ngx_quic_copy_buf(ngx_connection_t *c, u_char *data, size_t len)
|
|||
}
|
||||
|
||||
|
||||
ngx_chain_t *
|
||||
ngx_quic_copy_chain(ngx_connection_t *c, ngx_chain_t *in, size_t limit)
|
||||
{
|
||||
size_t n;
|
||||
ngx_buf_t *b;
|
||||
ngx_chain_t *cl, *out, **ll;
|
||||
|
||||
out = NULL;
|
||||
ll = &out;
|
||||
|
||||
while (in) {
|
||||
if (!ngx_buf_in_memory(in->buf) || ngx_buf_size(in->buf) == 0) {
|
||||
in = in->next;
|
||||
continue;
|
||||
}
|
||||
|
||||
cl = ngx_quic_alloc_chain(c);
|
||||
if (cl == NULL) {
|
||||
return NGX_CHAIN_ERROR;
|
||||
}
|
||||
|
||||
*ll = cl;
|
||||
ll = &cl->next;
|
||||
|
||||
b = cl->buf;
|
||||
|
||||
while (in && b->last != b->end) {
|
||||
|
||||
n = ngx_min(in->buf->last - in->buf->pos, b->end - b->last);
|
||||
|
||||
if (limit > 0 && n > limit) {
|
||||
n = limit;
|
||||
}
|
||||
|
||||
b->last = ngx_cpymem(b->last, in->buf->pos, n);
|
||||
|
||||
in->buf->pos += n;
|
||||
if (in->buf->pos == in->buf->last) {
|
||||
in = in->next;
|
||||
}
|
||||
|
||||
if (limit > 0) {
|
||||
if (limit == n) {
|
||||
goto done;
|
||||
}
|
||||
|
||||
limit -= n;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
done:
|
||||
|
||||
*ll = NULL;
|
||||
|
||||
return out;
|
||||
}
|
||||
|
||||
|
||||
ngx_chain_t *
|
||||
ngx_quic_write_chain(ngx_connection_t *c, ngx_chain_t **chain, ngx_chain_t *in,
|
||||
off_t limit, off_t offset)
|
||||
|
|
|
|||
|
|
@ -26,8 +26,6 @@ ngx_int_t ngx_quic_split_frame(ngx_connection_t *c, ngx_quic_frame_t *f,
|
|||
ngx_chain_t *ngx_quic_alloc_chain(ngx_connection_t *c);
|
||||
ngx_chain_t *ngx_quic_copy_buf(ngx_connection_t *c, u_char *data,
|
||||
size_t len);
|
||||
ngx_chain_t *ngx_quic_copy_chain(ngx_connection_t *c, ngx_chain_t *in,
|
||||
size_t limit);
|
||||
void ngx_quic_trim_chain(ngx_chain_t *in, size_t size);
|
||||
void ngx_quic_free_chain(ngx_connection_t *c, ngx_chain_t *in);
|
||||
ngx_chain_t *ngx_quic_read_chain(ngx_connection_t *c, ngx_chain_t **chain,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue