HTTP/3: renamed ngx_http_v3_connection_t to ngx_http_v3_session_t.

This commit is contained in:
Roman Arutyunyan 2021-05-05 12:54:10 +03:00
parent 968daa6a69
commit 193e598f14
7 changed files with 40 additions and 41 deletions

View file

@ -21,8 +21,7 @@ typedef struct ngx_http_log_ctx_s ngx_http_log_ctx_t;
typedef struct ngx_http_chunked_s ngx_http_chunked_t; typedef struct ngx_http_chunked_s ngx_http_chunked_t;
typedef struct ngx_http_v2_stream_s ngx_http_v2_stream_t; typedef struct ngx_http_v2_stream_s ngx_http_v2_stream_t;
typedef struct ngx_http_v3_parse_s ngx_http_v3_parse_t; typedef struct ngx_http_v3_parse_s ngx_http_v3_parse_t;
typedef struct ngx_http_v3_connection_s typedef struct ngx_http_v3_session_s ngx_http_v3_session_t;
ngx_http_v3_connection_t;
typedef ngx_int_t (*ngx_http_header_handler_pt)(ngx_http_request_t *r, typedef ngx_int_t (*ngx_http_header_handler_pt)(ngx_http_request_t *r,
ngx_table_elt_t *h, ngx_uint_t offset); ngx_table_elt_t *h, ngx_uint_t offset);

View file

@ -319,7 +319,7 @@ typedef struct {
#endif #endif
#if (NGX_HTTP_V3 || NGX_COMPAT) #if (NGX_HTTP_V3 || NGX_COMPAT)
ngx_http_v3_connection_t *v3_session; ngx_http_v3_session_t *v3_session;
#endif #endif
ngx_chain_t *busy; ngx_chain_t *busy;

View file

@ -127,7 +127,7 @@ typedef struct {
} ngx_http_v3_dynamic_table_t; } ngx_http_v3_dynamic_table_t;
struct ngx_http_v3_connection_s { struct ngx_http_v3_session_s {
ngx_http_v3_dynamic_table_t table; ngx_http_v3_dynamic_table_t table;
ngx_event_t keepalive; ngx_event_t keepalive;

View file

@ -775,12 +775,12 @@ static ngx_int_t
ngx_http_v3_push_resource(ngx_http_request_t *r, ngx_str_t *path, ngx_http_v3_push_resource(ngx_http_request_t *r, ngx_str_t *path,
ngx_chain_t ***ll) ngx_chain_t ***ll)
{ {
uint64_t push_id; uint64_t push_id;
ngx_int_t rc; ngx_int_t rc;
ngx_chain_t *cl; ngx_chain_t *cl;
ngx_connection_t *c; ngx_connection_t *c;
ngx_http_v3_srv_conf_t *h3scf; ngx_http_v3_session_t *h3c;
ngx_http_v3_connection_t *h3c; ngx_http_v3_srv_conf_t *h3scf;
c = r->connection; c = r->connection;
h3c = ngx_http_v3_get_session(c); h3c = ngx_http_v3_get_session(c);
@ -838,8 +838,8 @@ ngx_http_v3_create_push_request(ngx_http_request_t *pr, ngx_str_t *path,
ngx_http_request_t *r; ngx_http_request_t *r;
ngx_http_log_ctx_t *ctx; ngx_http_log_ctx_t *ctx;
ngx_http_connection_t *hc; ngx_http_connection_t *hc;
ngx_http_v3_session_t *h3c;
ngx_http_core_srv_conf_t *cscf; ngx_http_core_srv_conf_t *cscf;
ngx_http_v3_connection_t *h3c;
pc = pr->connection; pc = pr->connection;

View file

@ -59,7 +59,7 @@ ngx_http_v3_init(ngx_connection_t *c)
ngx_pool_cleanup_t *cln; ngx_pool_cleanup_t *cln;
ngx_http_request_t *r; ngx_http_request_t *r;
ngx_http_connection_t *hc; ngx_http_connection_t *hc;
ngx_http_v3_connection_t *h3c; ngx_http_v3_session_t *h3c;
ngx_http_core_loc_conf_t *clcf; ngx_http_core_loc_conf_t *clcf;
ngx_http_core_srv_conf_t *cscf; ngx_http_core_srv_conf_t *cscf;
@ -185,8 +185,8 @@ ngx_http_v3_cleanup_request(void *data)
{ {
ngx_connection_t *c = data; ngx_connection_t *c = data;
ngx_http_v3_session_t *h3c;
ngx_http_core_loc_conf_t *clcf; ngx_http_core_loc_conf_t *clcf;
ngx_http_v3_connection_t *h3c;
h3c = ngx_http_v3_get_session(c); h3c = ngx_http_v3_get_session(c);

View file

@ -47,7 +47,7 @@ ngx_http_v3_init_session(ngx_connection_t *c)
ngx_connection_t *pc; ngx_connection_t *pc;
ngx_pool_cleanup_t *cln; ngx_pool_cleanup_t *cln;
ngx_http_connection_t *hc; ngx_http_connection_t *hc;
ngx_http_v3_connection_t *h3c; ngx_http_v3_session_t *h3c;
pc = c->quic->parent; pc = c->quic->parent;
hc = pc->data; hc = pc->data;
@ -58,7 +58,7 @@ ngx_http_v3_init_session(ngx_connection_t *c)
ngx_log_debug0(NGX_LOG_DEBUG_HTTP, c->log, 0, "http3 init session"); ngx_log_debug0(NGX_LOG_DEBUG_HTTP, c->log, 0, "http3 init session");
h3c = ngx_pcalloc(pc->pool, sizeof(ngx_http_v3_connection_t)); h3c = ngx_pcalloc(pc->pool, sizeof(ngx_http_v3_session_t));
if (h3c == NULL) { if (h3c == NULL) {
return NGX_ERROR; return NGX_ERROR;
} }
@ -104,7 +104,7 @@ ngx_http_v3_keepalive_handler(ngx_event_t *ev)
static void static void
ngx_http_v3_cleanup_session(void *data) ngx_http_v3_cleanup_session(void *data)
{ {
ngx_http_v3_connection_t *h3c = data; ngx_http_v3_session_t *h3c = data;
if (h3c->keepalive.timer_set) { if (h3c->keepalive.timer_set) {
ngx_del_timer(&h3c->keepalive); ngx_del_timer(&h3c->keepalive);
@ -142,7 +142,7 @@ static void
ngx_http_v3_close_uni_stream(ngx_connection_t *c) ngx_http_v3_close_uni_stream(ngx_connection_t *c)
{ {
ngx_pool_t *pool; ngx_pool_t *pool;
ngx_http_v3_connection_t *h3c; ngx_http_v3_session_t *h3c;
ngx_http_v3_uni_stream_t *us; ngx_http_v3_uni_stream_t *us;
us = c->data; us = c->data;
@ -171,7 +171,7 @@ ngx_http_v3_read_uni_stream_type(ngx_event_t *rev)
ssize_t n; ssize_t n;
ngx_int_t index, rc; ngx_int_t index, rc;
ngx_connection_t *c; ngx_connection_t *c;
ngx_http_v3_connection_t *h3c; ngx_http_v3_session_t *h3c;
ngx_http_v3_uni_stream_t *us; ngx_http_v3_uni_stream_t *us;
c = rev->data; c = rev->data;
@ -379,12 +379,12 @@ ngx_http_v3_dummy_write_handler(ngx_event_t *wev)
ngx_connection_t * ngx_connection_t *
ngx_http_v3_create_push_stream(ngx_connection_t *c, uint64_t push_id) ngx_http_v3_create_push_stream(ngx_connection_t *c, uint64_t push_id)
{ {
u_char *p, buf[NGX_HTTP_V3_VARLEN_INT_LEN * 2]; u_char *p, buf[NGX_HTTP_V3_VARLEN_INT_LEN * 2];
size_t n; size_t n;
ngx_connection_t *sc; ngx_connection_t *sc;
ngx_pool_cleanup_t *cln; ngx_pool_cleanup_t *cln;
ngx_http_v3_push_t *push; ngx_http_v3_push_t *push;
ngx_http_v3_connection_t *h3c; ngx_http_v3_session_t *h3c;
ngx_log_debug1(NGX_LOG_DEBUG_HTTP, c->log, 0, ngx_log_debug1(NGX_LOG_DEBUG_HTTP, c->log, 0,
"http3 create push stream id:%uL", push_id); "http3 create push stream id:%uL", push_id);
@ -447,7 +447,7 @@ ngx_http_v3_get_uni_stream(ngx_connection_t *c, ngx_uint_t type)
size_t n; size_t n;
ngx_int_t index; ngx_int_t index;
ngx_connection_t *sc; ngx_connection_t *sc;
ngx_http_v3_connection_t *h3c; ngx_http_v3_session_t *h3c;
ngx_http_v3_uni_stream_t *us; ngx_http_v3_uni_stream_t *us;
switch (type) { switch (type) {
@ -830,7 +830,7 @@ ngx_http_v3_client_inc_insert_count(ngx_connection_t *c, ngx_uint_t inc)
ngx_int_t ngx_int_t
ngx_http_v3_set_max_push_id(ngx_connection_t *c, uint64_t max_push_id) ngx_http_v3_set_max_push_id(ngx_connection_t *c, uint64_t max_push_id)
{ {
ngx_http_v3_connection_t *h3c; ngx_http_v3_session_t *h3c;
h3c = ngx_http_v3_get_session(c); h3c = ngx_http_v3_get_session(c);
@ -850,10 +850,10 @@ ngx_http_v3_set_max_push_id(ngx_connection_t *c, uint64_t max_push_id)
ngx_int_t ngx_int_t
ngx_http_v3_cancel_push(ngx_connection_t *c, uint64_t push_id) ngx_http_v3_cancel_push(ngx_connection_t *c, uint64_t push_id)
{ {
ngx_queue_t *q; ngx_queue_t *q;
ngx_http_request_t *r; ngx_http_request_t *r;
ngx_http_v3_push_t *push; ngx_http_v3_push_t *push;
ngx_http_v3_connection_t *h3c; ngx_http_v3_session_t *h3c;
h3c = ngx_http_v3_get_session(c); h3c = ngx_http_v3_get_session(c);

View file

@ -189,7 +189,7 @@ ngx_http_v3_insert(ngx_connection_t *c, ngx_str_t *name, ngx_str_t *value)
u_char *p; u_char *p;
size_t size; size_t size;
ngx_http_v3_header_t *h; ngx_http_v3_header_t *h;
ngx_http_v3_connection_t *h3c; ngx_http_v3_session_t *h3c;
ngx_http_v3_dynamic_table_t *dt; ngx_http_v3_dynamic_table_t *dt;
size = ngx_http_v3_table_entry_size(name, value); size = ngx_http_v3_table_entry_size(name, value);
@ -243,8 +243,8 @@ ngx_http_v3_set_capacity(ngx_connection_t *c, ngx_uint_t capacity)
ngx_connection_t *pc; ngx_connection_t *pc;
ngx_pool_cleanup_t *cln; ngx_pool_cleanup_t *cln;
ngx_http_v3_header_t **elts; ngx_http_v3_header_t **elts;
ngx_http_v3_session_t *h3c;
ngx_http_v3_srv_conf_t *h3scf; ngx_http_v3_srv_conf_t *h3scf;
ngx_http_v3_connection_t *h3c;
ngx_http_v3_dynamic_table_t *dt; ngx_http_v3_dynamic_table_t *dt;
ngx_log_debug1(NGX_LOG_DEBUG_HTTP, c->log, 0, ngx_log_debug1(NGX_LOG_DEBUG_HTTP, c->log, 0,
@ -322,7 +322,7 @@ ngx_http_v3_evict(ngx_connection_t *c, size_t need)
size_t size, target; size_t size, target;
ngx_uint_t n; ngx_uint_t n;
ngx_http_v3_header_t *h; ngx_http_v3_header_t *h;
ngx_http_v3_connection_t *h3c; ngx_http_v3_session_t *h3c;
ngx_http_v3_dynamic_table_t *dt; ngx_http_v3_dynamic_table_t *dt;
h3c = ngx_http_v3_get_session(c); h3c = ngx_http_v3_get_session(c);
@ -363,7 +363,7 @@ ngx_int_t
ngx_http_v3_duplicate(ngx_connection_t *c, ngx_uint_t index) ngx_http_v3_duplicate(ngx_connection_t *c, ngx_uint_t index)
{ {
ngx_str_t name, value; ngx_str_t name, value;
ngx_http_v3_connection_t *h3c; ngx_http_v3_session_t *h3c;
ngx_http_v3_dynamic_table_t *dt; ngx_http_v3_dynamic_table_t *dt;
ngx_log_debug1(NGX_LOG_DEBUG_HTTP, c->log, 0, "http3 duplicate %ui", index); ngx_log_debug1(NGX_LOG_DEBUG_HTTP, c->log, 0, "http3 duplicate %ui", index);
@ -449,7 +449,7 @@ ngx_http_v3_lookup(ngx_connection_t *c, ngx_uint_t index, ngx_str_t *name,
ngx_str_t *value) ngx_str_t *value)
{ {
ngx_http_v3_header_t *h; ngx_http_v3_header_t *h;
ngx_http_v3_connection_t *h3c; ngx_http_v3_session_t *h3c;
ngx_http_v3_dynamic_table_t *dt; ngx_http_v3_dynamic_table_t *dt;
h3c = ngx_http_v3_get_session(c); h3c = ngx_http_v3_get_session(c);
@ -486,7 +486,7 @@ ngx_http_v3_decode_insert_count(ngx_connection_t *c, ngx_uint_t *insert_count)
ngx_uint_t max_entries, full_range, max_value, ngx_uint_t max_entries, full_range, max_value,
max_wrapped, req_insert_count; max_wrapped, req_insert_count;
ngx_http_v3_srv_conf_t *h3scf; ngx_http_v3_srv_conf_t *h3scf;
ngx_http_v3_connection_t *h3c; ngx_http_v3_session_t *h3c;
ngx_http_v3_dynamic_table_t *dt; ngx_http_v3_dynamic_table_t *dt;
/* QPACK 4.5.1.1. Required Insert Count */ /* QPACK 4.5.1.1. Required Insert Count */
@ -539,8 +539,8 @@ ngx_http_v3_check_insert_count(ngx_connection_t *c, ngx_uint_t insert_count)
size_t n; size_t n;
ngx_pool_cleanup_t *cln; ngx_pool_cleanup_t *cln;
ngx_http_v3_block_t *block; ngx_http_v3_block_t *block;
ngx_http_v3_session_t *h3c;
ngx_http_v3_srv_conf_t *h3scf; ngx_http_v3_srv_conf_t *h3scf;
ngx_http_v3_connection_t *h3c;
ngx_http_v3_dynamic_table_t *dt; ngx_http_v3_dynamic_table_t *dt;
h3c = ngx_http_v3_get_session(c); h3c = ngx_http_v3_get_session(c);
@ -617,10 +617,10 @@ ngx_http_v3_unblock(void *data)
static ngx_int_t static ngx_int_t
ngx_http_v3_new_header(ngx_connection_t *c) ngx_http_v3_new_header(ngx_connection_t *c)
{ {
ngx_queue_t *q; ngx_queue_t *q;
ngx_connection_t *bc; ngx_connection_t *bc;
ngx_http_v3_block_t *block; ngx_http_v3_block_t *block;
ngx_http_v3_connection_t *h3c; ngx_http_v3_session_t *h3c;
h3c = ngx_http_v3_get_session(c); h3c = ngx_http_v3_get_session(c);