changeset 8948:19e063e955bf quic

QUIC: renamed buffer-related functions. ngx_quic_alloc_buf() -> ngx_quic_alloc_chain(), ngx_quic_free_bufs() -> ngx_quic_free_chain(), ngx_quic_trim_bufs() -> ngx_quic_trim_chain()
author Roman Arutyunyan <arut@nginx.com>
date Thu, 16 Dec 2021 17:06:35 +0300
parents 6ccf3867959a
children 2e22110828dd
files src/event/quic/ngx_event_quic.c src/event/quic/ngx_event_quic_frames.c src/event/quic/ngx_event_quic_frames.h src/event/quic/ngx_event_quic_output.c src/event/quic/ngx_event_quic_ssl.c src/event/quic/ngx_event_quic_streams.c
diffstat 6 files changed, 20 insertions(+), 20 deletions(-) [+]
line wrap: on
line diff
--- a/src/event/quic/ngx_event_quic.c
+++ b/src/event/quic/ngx_event_quic.c
@@ -1085,7 +1085,7 @@ ngx_quic_discard_ctx(ngx_connection_t *c
 
     ctx = ngx_quic_get_send_ctx(qc, level);
 
-    ngx_quic_free_bufs(c, ctx->crypto);
+    ngx_quic_free_chain(c, ctx->crypto);
 
     while (!ngx_queue_empty(&ctx->sent)) {
         q = ngx_queue_head(&ctx->sent);
--- a/src/event/quic/ngx_event_quic_frames.c
+++ b/src/event/quic/ngx_event_quic_frames.c
@@ -66,7 +66,7 @@ ngx_quic_free_frame(ngx_connection_t *c,
     qc = ngx_quic_get_connection(c);
 
     if (frame->data) {
-        ngx_quic_free_bufs(c, frame->data);
+        ngx_quic_free_chain(c, frame->data);
     }
 
     ngx_queue_insert_head(&qc->free_frames, &frame->queue);
@@ -79,7 +79,7 @@ ngx_quic_free_frame(ngx_connection_t *c,
 
 
 void
-ngx_quic_trim_bufs(ngx_chain_t *in, size_t size)
+ngx_quic_trim_chain(ngx_chain_t *in, size_t size)
 {
     size_t      n;
     ngx_buf_t  *b;
@@ -99,7 +99,7 @@ ngx_quic_trim_bufs(ngx_chain_t *in, size
 
 
 void
-ngx_quic_free_bufs(ngx_connection_t *c, ngx_chain_t *in)
+ngx_quic_free_chain(ngx_connection_t *c, ngx_chain_t *in)
 {
     ngx_buf_t              *b, *shadow;
     ngx_chain_t            *cl;
@@ -347,7 +347,7 @@ split:
 
 
 ngx_chain_t *
-ngx_quic_alloc_buf(ngx_connection_t *c)
+ngx_quic_alloc_chain(ngx_connection_t *c)
 {
     ngx_buf_t              *b;
     ngx_chain_t            *cl;
@@ -381,7 +381,7 @@ ngx_quic_alloc_buf(ngx_connection_t *c)
         return NULL;
     }
 
-    b->tag = (ngx_buf_tag_t) &ngx_quic_alloc_buf;
+    b->tag = (ngx_buf_tag_t) &ngx_quic_alloc_chain;
 
     cl->buf = b;
 
@@ -407,7 +407,7 @@ ngx_quic_copy_buf(ngx_connection_t *c, u
     ll = &out;
 
     while (len) {
-        cl = ngx_quic_alloc_buf(c);
+        cl = ngx_quic_alloc_chain(c);
         if (cl == NULL) {
             return NGX_CHAIN_ERROR;
         }
@@ -446,7 +446,7 @@ ngx_quic_copy_chain(ngx_connection_t *c,
             continue;
         }
 
-        cl = ngx_quic_alloc_buf(c);
+        cl = ngx_quic_alloc_chain(c);
         if (cl == NULL) {
             return NGX_CHAIN_ERROR;
         }
@@ -502,7 +502,7 @@ ngx_quic_write_chain(ngx_connection_t *c
         cl = *chain;
 
         if (cl == NULL) {
-            cl = ngx_quic_alloc_buf(c);
+            cl = ngx_quic_alloc_chain(c);
             if (cl == NULL) {
                 return NGX_CHAIN_ERROR;
             }
--- a/src/event/quic/ngx_event_quic_frames.h
+++ b/src/event/quic/ngx_event_quic_frames.h
@@ -23,13 +23,13 @@ void ngx_quic_queue_frame(ngx_quic_conne
 ngx_int_t ngx_quic_split_frame(ngx_connection_t *c, ngx_quic_frame_t *f,
     size_t len);
 
-ngx_chain_t *ngx_quic_alloc_buf(ngx_connection_t *c);
+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_bufs(ngx_chain_t *in, size_t size);
-void ngx_quic_free_bufs(ngx_connection_t *c, ngx_chain_t *in);
+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,
     off_t limit);
 ngx_chain_t *ngx_quic_write_chain(ngx_connection_t *c, ngx_chain_t **chain,
--- a/src/event/quic/ngx_event_quic_output.c
+++ b/src/event/quic/ngx_event_quic_output.c
@@ -1121,7 +1121,7 @@ ngx_quic_send_ack(ngx_connection_t *c, n
         left = b ? b->end - b->last : 0;
 
         if (left < len) {
-            cl = ngx_quic_alloc_buf(c);
+            cl = ngx_quic_alloc_chain(c);
             if (cl == NULL) {
                 return NGX_ERROR;
             }
--- a/src/event/quic/ngx_event_quic_ssl.c
+++ b/src/event/quic/ngx_event_quic_ssl.c
@@ -379,13 +379,13 @@ ngx_quic_handle_crypto_frame(ngx_connect
         return NGX_OK;
     }
 
-    ngx_quic_trim_bufs(frame->data, ctx->crypto_received - f->offset);
+    ngx_quic_trim_chain(frame->data, ctx->crypto_received - f->offset);
 
     if (ngx_quic_crypto_input(c, frame->data) != NGX_OK) {
         return NGX_ERROR;
     }
 
-    ngx_quic_trim_bufs(ctx->crypto, last - ctx->crypto_received);
+    ngx_quic_trim_chain(ctx->crypto, last - ctx->crypto_received);
     ctx->crypto_received = last;
 
     cl = ctx->crypto;
@@ -413,7 +413,7 @@ ngx_quic_handle_crypto_frame(ngx_connect
             return NGX_ERROR;
         }
 
-        ngx_quic_free_bufs(c, cl);
+        ngx_quic_free_chain(c, cl);
     }
 
     return NGX_OK;
--- a/src/event/quic/ngx_event_quic_streams.c
+++ b/src/event/quic/ngx_event_quic_streams.c
@@ -777,7 +777,7 @@ ngx_quic_stream_recv(ngx_connection_t *c
         buf = ngx_cpymem(buf, b->pos, b->last - b->pos);
     }
 
-    ngx_quic_free_bufs(pc, in);
+    ngx_quic_free_chain(pc, in);
 
     if (qs->in == NULL) {
         rev->ready = rev->pending_eof;
@@ -975,8 +975,8 @@ ngx_quic_stream_cleanup_handler(void *da
                    "quic stream id:0x%xL cleanup", qs->id);
 
     ngx_rbtree_delete(&qc->streams.tree, &qs->node);
-    ngx_quic_free_bufs(pc, qs->in);
-    ngx_quic_free_bufs(pc, qs->out);
+    ngx_quic_free_chain(pc, qs->in);
+    ngx_quic_free_chain(pc, qs->out);
 
     if (qc->closing) {
         /* schedule handler call to continue ngx_quic_close_connection() */
@@ -1079,7 +1079,7 @@ ngx_quic_handle_stream_frame(ngx_connect
     }
 
     if (f->offset < qs->recv_offset) {
-        ngx_quic_trim_bufs(frame->data, qs->recv_offset - f->offset);
+        ngx_quic_trim_chain(frame->data, qs->recv_offset - f->offset);
         f->offset = qs->recv_offset;
     }