]> git.kaiwu.me - nginx.git/commitdiff
QUIC: removed ngx_quic_copy_chain().
authorRoman Arutyunyan <arut@nginx.com>
Thu, 16 Dec 2021 14:07:11 +0000 (17:07 +0300)
committerRoman Arutyunyan <arut@nginx.com>
Thu, 16 Dec 2021 14:07:11 +0000 (17:07 +0300)
The function is unused.

src/event/quic/ngx_event_quic_frames.c
src/event/quic/ngx_event_quic_frames.h

index d4b0cf1c032f80cc1b4278b727d6127d29a7a15a..98400ea87b3ab322edae95e8beb72d5c88e40519 100644 (file)
@@ -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)
index 671b6e6494752fab74510d2f508c9dd5fac23863..45505601fd3b35ae07f9e64af3c3cd1d7f6f5482 100644 (file)
@@ -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,