Mercurial > hg > nginx-quic
comparison src/http/v3/ngx_http_v3_tables.c @ 8010:65c1fc5fae15 quic
HTTP/3: renamed server configuration variables from v3cf to h3scf.
Now they are similar to HTTP/2 where they are called h2scf.
author | Roman Arutyunyan <arut@nginx.com> |
---|---|
date | Thu, 23 Jul 2020 13:12:01 +0300 |
parents | 72f9ff4e0a88 |
children | 279ad36f2f4b |
comparison
equal
deleted
inserted
replaced
8009:6e1798a4a0d2 | 8010:65c1fc5fae15 |
---|---|
241 { | 241 { |
242 ngx_uint_t max, prev_max; | 242 ngx_uint_t max, prev_max; |
243 ngx_connection_t *pc; | 243 ngx_connection_t *pc; |
244 ngx_pool_cleanup_t *cln; | 244 ngx_pool_cleanup_t *cln; |
245 ngx_http_v3_header_t **elts; | 245 ngx_http_v3_header_t **elts; |
246 ngx_http_v3_srv_conf_t *v3cf; | 246 ngx_http_v3_srv_conf_t *h3scf; |
247 ngx_http_v3_connection_t *h3c; | 247 ngx_http_v3_connection_t *h3c; |
248 ngx_http_v3_dynamic_table_t *dt; | 248 ngx_http_v3_dynamic_table_t *dt; |
249 | 249 |
250 ngx_log_debug1(NGX_LOG_DEBUG_HTTP, c->log, 0, | 250 ngx_log_debug1(NGX_LOG_DEBUG_HTTP, c->log, 0, |
251 "http3 set capacity %ui", capacity); | 251 "http3 set capacity %ui", capacity); |
252 | 252 |
253 pc = c->qs->parent; | 253 pc = c->qs->parent; |
254 h3c = pc->data; | 254 h3c = pc->data; |
255 v3cf = ngx_http_get_module_srv_conf(h3c->hc.conf_ctx, ngx_http_v3_module); | 255 h3scf = ngx_http_get_module_srv_conf(h3c->hc.conf_ctx, ngx_http_v3_module); |
256 | 256 |
257 if (capacity > v3cf->max_table_capacity) { | 257 if (capacity > h3scf->max_table_capacity) { |
258 ngx_log_error(NGX_LOG_INFO, c->log, 0, | 258 ngx_log_error(NGX_LOG_INFO, c->log, 0, |
259 "client exceeded http3_max_table_capacity limit"); | 259 "client exceeded http3_max_table_capacity limit"); |
260 return NGX_HTTP_V3_ERR_ENCODER_STREAM_ERROR; | 260 return NGX_HTTP_V3_ERR_ENCODER_STREAM_ERROR; |
261 } | 261 } |
262 | 262 |
494 ngx_int_t | 494 ngx_int_t |
495 ngx_http_v3_decode_insert_count(ngx_connection_t *c, ngx_uint_t *insert_count) | 495 ngx_http_v3_decode_insert_count(ngx_connection_t *c, ngx_uint_t *insert_count) |
496 { | 496 { |
497 ngx_uint_t max_entries, full_range, max_value, | 497 ngx_uint_t max_entries, full_range, max_value, |
498 max_wrapped, req_insert_count; | 498 max_wrapped, req_insert_count; |
499 ngx_http_v3_srv_conf_t *v3cf; | 499 ngx_http_v3_srv_conf_t *h3scf; |
500 ngx_http_v3_connection_t *h3c; | 500 ngx_http_v3_connection_t *h3c; |
501 ngx_http_v3_dynamic_table_t *dt; | 501 ngx_http_v3_dynamic_table_t *dt; |
502 | 502 |
503 /* QPACK 4.5.1.1. Required Insert Count */ | 503 /* QPACK 4.5.1.1. Required Insert Count */ |
504 | 504 |
507 } | 507 } |
508 | 508 |
509 h3c = c->qs->parent->data; | 509 h3c = c->qs->parent->data; |
510 dt = &h3c->table; | 510 dt = &h3c->table; |
511 | 511 |
512 v3cf = ngx_http_get_module_srv_conf(h3c->hc.conf_ctx, ngx_http_v3_module); | 512 h3scf = ngx_http_get_module_srv_conf(h3c->hc.conf_ctx, ngx_http_v3_module); |
513 | 513 |
514 max_entries = v3cf->max_table_capacity / 32; | 514 max_entries = h3scf->max_table_capacity / 32; |
515 full_range = 2 * max_entries; | 515 full_range = 2 * max_entries; |
516 | 516 |
517 if (*insert_count > full_range) { | 517 if (*insert_count > full_range) { |
518 return NGX_HTTP_V3_ERR_DECOMPRESSION_FAILED; | 518 return NGX_HTTP_V3_ERR_DECOMPRESSION_FAILED; |
519 } | 519 } |
549 { | 549 { |
550 size_t n; | 550 size_t n; |
551 ngx_connection_t *pc; | 551 ngx_connection_t *pc; |
552 ngx_pool_cleanup_t *cln; | 552 ngx_pool_cleanup_t *cln; |
553 ngx_http_v3_block_t *block; | 553 ngx_http_v3_block_t *block; |
554 ngx_http_v3_srv_conf_t *v3cf; | 554 ngx_http_v3_srv_conf_t *h3scf; |
555 ngx_http_v3_connection_t *h3c; | 555 ngx_http_v3_connection_t *h3c; |
556 ngx_http_v3_dynamic_table_t *dt; | 556 ngx_http_v3_dynamic_table_t *dt; |
557 | 557 |
558 pc = c->qs->parent; | 558 pc = c->qs->parent; |
559 h3c = pc->data; | 559 h3c = pc->data; |
593 block->connection = c; | 593 block->connection = c; |
594 block->nblocked = &h3c->nblocked; | 594 block->nblocked = &h3c->nblocked; |
595 } | 595 } |
596 | 596 |
597 if (block->queue.prev == NULL) { | 597 if (block->queue.prev == NULL) { |
598 v3cf = ngx_http_get_module_srv_conf(h3c->hc.conf_ctx, | 598 h3scf = ngx_http_get_module_srv_conf(h3c->hc.conf_ctx, |
599 ngx_http_v3_module); | 599 ngx_http_v3_module); |
600 | 600 |
601 if (h3c->nblocked == v3cf->max_blocked_streams) { | 601 if (h3c->nblocked == h3scf->max_blocked_streams) { |
602 ngx_log_error(NGX_LOG_INFO, c->log, 0, | 602 ngx_log_error(NGX_LOG_INFO, c->log, 0, |
603 "client exceeded http3_max_blocked_streams limit"); | 603 "client exceeded http3_max_blocked_streams limit"); |
604 return NGX_HTTP_V3_ERR_DECOMPRESSION_FAILED; | 604 return NGX_HTTP_V3_ERR_DECOMPRESSION_FAILED; |
605 } | 605 } |
606 | 606 |