mirror of
https://github.com/nginx/nginx.git
synced 2025-08-06 06:46:16 +08:00
HTTP/3: renamed server configuration variables from v3cf to h3scf.
Now they are similar to HTTP/2 where they are called h2scf.
This commit is contained in:
parent
47ed87f855
commit
f2368597c2
@ -127,18 +127,18 @@ ngx_http_v3_add_variables(ngx_conf_t *cf)
|
||||
static void *
|
||||
ngx_http_v3_create_srv_conf(ngx_conf_t *cf)
|
||||
{
|
||||
ngx_http_v3_srv_conf_t *v3cf;
|
||||
ngx_http_v3_srv_conf_t *h3scf;
|
||||
|
||||
v3cf = ngx_pcalloc(cf->pool, sizeof(ngx_http_v3_srv_conf_t));
|
||||
if (v3cf == NULL) {
|
||||
h3scf = ngx_pcalloc(cf->pool, sizeof(ngx_http_v3_srv_conf_t));
|
||||
if (h3scf == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
v3cf->max_field_size = NGX_CONF_UNSET_SIZE;
|
||||
v3cf->max_table_capacity = NGX_CONF_UNSET_SIZE;
|
||||
v3cf->max_blocked_streams = NGX_CONF_UNSET_UINT;
|
||||
h3scf->max_field_size = NGX_CONF_UNSET_SIZE;
|
||||
h3scf->max_table_capacity = NGX_CONF_UNSET_SIZE;
|
||||
h3scf->max_blocked_streams = NGX_CONF_UNSET_UINT;
|
||||
|
||||
return v3cf;
|
||||
return h3scf;
|
||||
}
|
||||
|
||||
|
||||
|
@ -426,7 +426,7 @@ ngx_http_v3_parse_literal(ngx_connection_t *c, ngx_http_v3_parse_literal_t *st,
|
||||
u_char ch)
|
||||
{
|
||||
ngx_uint_t n;
|
||||
ngx_http_v3_srv_conf_t *v3cf;
|
||||
ngx_http_v3_srv_conf_t *h3scf;
|
||||
enum {
|
||||
sw_start = 0,
|
||||
sw_value
|
||||
@ -442,9 +442,9 @@ ngx_http_v3_parse_literal(ngx_connection_t *c, ngx_http_v3_parse_literal_t *st,
|
||||
|
||||
n = st->length;
|
||||
|
||||
v3cf = ngx_http_v3_get_module_srv_conf(c, ngx_http_v3_module);
|
||||
h3scf = ngx_http_v3_get_module_srv_conf(c, ngx_http_v3_module);
|
||||
|
||||
if (n > v3cf->max_field_size) {
|
||||
if (n > h3scf->max_field_size) {
|
||||
ngx_log_error(NGX_LOG_INFO, c->log, 0,
|
||||
"client exceeded http3_max_field_size limit");
|
||||
return NGX_HTTP_V3_ERR_EXCESSIVE_LOAD;
|
||||
|
@ -407,7 +407,7 @@ ngx_http_v3_send_settings(ngx_connection_t *c)
|
||||
u_char *p, buf[NGX_HTTP_V3_VARLEN_INT_LEN * 6];
|
||||
size_t n;
|
||||
ngx_connection_t *cc;
|
||||
ngx_http_v3_srv_conf_t *v3cf;
|
||||
ngx_http_v3_srv_conf_t *h3scf;
|
||||
ngx_http_v3_connection_t *h3c;
|
||||
|
||||
ngx_log_debug0(NGX_LOG_DEBUG_HTTP, c->log, 0, "http3 send settings");
|
||||
@ -418,23 +418,23 @@ ngx_http_v3_send_settings(ngx_connection_t *c)
|
||||
}
|
||||
|
||||
h3c = c->qs->parent->data;
|
||||
v3cf = ngx_http_get_module_srv_conf(h3c->hc.conf_ctx, ngx_http_v3_module);
|
||||
h3scf = ngx_http_get_module_srv_conf(h3c->hc.conf_ctx, ngx_http_v3_module);
|
||||
|
||||
n = ngx_http_v3_encode_varlen_int(NULL,
|
||||
NGX_HTTP_V3_PARAM_MAX_TABLE_CAPACITY);
|
||||
n += ngx_http_v3_encode_varlen_int(NULL, v3cf->max_table_capacity);
|
||||
n += ngx_http_v3_encode_varlen_int(NULL, h3scf->max_table_capacity);
|
||||
n += ngx_http_v3_encode_varlen_int(NULL, NGX_HTTP_V3_PARAM_BLOCKED_STREAMS);
|
||||
n += ngx_http_v3_encode_varlen_int(NULL, v3cf->max_blocked_streams);
|
||||
n += ngx_http_v3_encode_varlen_int(NULL, h3scf->max_blocked_streams);
|
||||
|
||||
p = (u_char *) ngx_http_v3_encode_varlen_int(buf,
|
||||
NGX_HTTP_V3_FRAME_SETTINGS);
|
||||
p = (u_char *) ngx_http_v3_encode_varlen_int(p, n);
|
||||
p = (u_char *) ngx_http_v3_encode_varlen_int(p,
|
||||
NGX_HTTP_V3_PARAM_MAX_TABLE_CAPACITY);
|
||||
p = (u_char *) ngx_http_v3_encode_varlen_int(p, v3cf->max_table_capacity);
|
||||
p = (u_char *) ngx_http_v3_encode_varlen_int(p, h3scf->max_table_capacity);
|
||||
p = (u_char *) ngx_http_v3_encode_varlen_int(p,
|
||||
NGX_HTTP_V3_PARAM_BLOCKED_STREAMS);
|
||||
p = (u_char *) ngx_http_v3_encode_varlen_int(p, v3cf->max_blocked_streams);
|
||||
p = (u_char *) ngx_http_v3_encode_varlen_int(p, h3scf->max_blocked_streams);
|
||||
n = p - buf;
|
||||
|
||||
if (cc->send(cc, buf, n) != (ssize_t) n) {
|
||||
|
@ -243,7 +243,7 @@ ngx_http_v3_set_capacity(ngx_connection_t *c, ngx_uint_t capacity)
|
||||
ngx_connection_t *pc;
|
||||
ngx_pool_cleanup_t *cln;
|
||||
ngx_http_v3_header_t **elts;
|
||||
ngx_http_v3_srv_conf_t *v3cf;
|
||||
ngx_http_v3_srv_conf_t *h3scf;
|
||||
ngx_http_v3_connection_t *h3c;
|
||||
ngx_http_v3_dynamic_table_t *dt;
|
||||
|
||||
@ -252,9 +252,9 @@ ngx_http_v3_set_capacity(ngx_connection_t *c, ngx_uint_t capacity)
|
||||
|
||||
pc = c->qs->parent;
|
||||
h3c = pc->data;
|
||||
v3cf = ngx_http_get_module_srv_conf(h3c->hc.conf_ctx, ngx_http_v3_module);
|
||||
h3scf = ngx_http_get_module_srv_conf(h3c->hc.conf_ctx, ngx_http_v3_module);
|
||||
|
||||
if (capacity > v3cf->max_table_capacity) {
|
||||
if (capacity > h3scf->max_table_capacity) {
|
||||
ngx_log_error(NGX_LOG_INFO, c->log, 0,
|
||||
"client exceeded http3_max_table_capacity limit");
|
||||
return NGX_HTTP_V3_ERR_ENCODER_STREAM_ERROR;
|
||||
@ -496,7 +496,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,
|
||||
max_wrapped, req_insert_count;
|
||||
ngx_http_v3_srv_conf_t *v3cf;
|
||||
ngx_http_v3_srv_conf_t *h3scf;
|
||||
ngx_http_v3_connection_t *h3c;
|
||||
ngx_http_v3_dynamic_table_t *dt;
|
||||
|
||||
@ -509,9 +509,9 @@ ngx_http_v3_decode_insert_count(ngx_connection_t *c, ngx_uint_t *insert_count)
|
||||
h3c = c->qs->parent->data;
|
||||
dt = &h3c->table;
|
||||
|
||||
v3cf = ngx_http_get_module_srv_conf(h3c->hc.conf_ctx, ngx_http_v3_module);
|
||||
h3scf = ngx_http_get_module_srv_conf(h3c->hc.conf_ctx, ngx_http_v3_module);
|
||||
|
||||
max_entries = v3cf->max_table_capacity / 32;
|
||||
max_entries = h3scf->max_table_capacity / 32;
|
||||
full_range = 2 * max_entries;
|
||||
|
||||
if (*insert_count > full_range) {
|
||||
@ -551,7 +551,7 @@ ngx_http_v3_check_insert_count(ngx_connection_t *c, ngx_uint_t insert_count)
|
||||
ngx_connection_t *pc;
|
||||
ngx_pool_cleanup_t *cln;
|
||||
ngx_http_v3_block_t *block;
|
||||
ngx_http_v3_srv_conf_t *v3cf;
|
||||
ngx_http_v3_srv_conf_t *h3scf;
|
||||
ngx_http_v3_connection_t *h3c;
|
||||
ngx_http_v3_dynamic_table_t *dt;
|
||||
|
||||
@ -595,10 +595,10 @@ ngx_http_v3_check_insert_count(ngx_connection_t *c, ngx_uint_t insert_count)
|
||||
}
|
||||
|
||||
if (block->queue.prev == NULL) {
|
||||
v3cf = ngx_http_get_module_srv_conf(h3c->hc.conf_ctx,
|
||||
ngx_http_v3_module);
|
||||
h3scf = ngx_http_get_module_srv_conf(h3c->hc.conf_ctx,
|
||||
ngx_http_v3_module);
|
||||
|
||||
if (h3c->nblocked == v3cf->max_blocked_streams) {
|
||||
if (h3c->nblocked == h3scf->max_blocked_streams) {
|
||||
ngx_log_error(NGX_LOG_INFO, c->log, 0,
|
||||
"client exceeded http3_max_blocked_streams limit");
|
||||
return NGX_HTTP_V3_ERR_DECOMPRESSION_FAILED;
|
||||
|
Loading…
Reference in New Issue
Block a user