comparison src/http/v3/ngx_http_v3_tables.c @ 8770:67f0eb150047 quic

HTTP/3: renamed ngx_http_v3_connection_t to ngx_http_v3_session_t.
author Roman Arutyunyan <arut@nginx.com>
date Wed, 05 May 2021 12:54:10 +0300
parents 9ec3e71f8a61
children 0981329169ea
comparison
equal deleted inserted replaced
8769:9ec3e71f8a61 8770:67f0eb150047
187 ngx_http_v3_insert(ngx_connection_t *c, ngx_str_t *name, ngx_str_t *value) 187 ngx_http_v3_insert(ngx_connection_t *c, ngx_str_t *name, ngx_str_t *value)
188 { 188 {
189 u_char *p; 189 u_char *p;
190 size_t size; 190 size_t size;
191 ngx_http_v3_header_t *h; 191 ngx_http_v3_header_t *h;
192 ngx_http_v3_connection_t *h3c; 192 ngx_http_v3_session_t *h3c;
193 ngx_http_v3_dynamic_table_t *dt; 193 ngx_http_v3_dynamic_table_t *dt;
194 194
195 size = ngx_http_v3_table_entry_size(name, value); 195 size = ngx_http_v3_table_entry_size(name, value);
196 196
197 if (ngx_http_v3_evict(c, size) != NGX_OK) { 197 if (ngx_http_v3_evict(c, size) != NGX_OK) {
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_session_t *h3c;
246 ngx_http_v3_srv_conf_t *h3scf; 247 ngx_http_v3_srv_conf_t *h3scf;
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
320 ngx_http_v3_evict(ngx_connection_t *c, size_t need) 320 ngx_http_v3_evict(ngx_connection_t *c, size_t need)
321 { 321 {
322 size_t size, target; 322 size_t size, target;
323 ngx_uint_t n; 323 ngx_uint_t n;
324 ngx_http_v3_header_t *h; 324 ngx_http_v3_header_t *h;
325 ngx_http_v3_connection_t *h3c; 325 ngx_http_v3_session_t *h3c;
326 ngx_http_v3_dynamic_table_t *dt; 326 ngx_http_v3_dynamic_table_t *dt;
327 327
328 h3c = ngx_http_v3_get_session(c); 328 h3c = ngx_http_v3_get_session(c);
329 dt = &h3c->table; 329 dt = &h3c->table;
330 330
361 361
362 ngx_int_t 362 ngx_int_t
363 ngx_http_v3_duplicate(ngx_connection_t *c, ngx_uint_t index) 363 ngx_http_v3_duplicate(ngx_connection_t *c, ngx_uint_t index)
364 { 364 {
365 ngx_str_t name, value; 365 ngx_str_t name, value;
366 ngx_http_v3_connection_t *h3c; 366 ngx_http_v3_session_t *h3c;
367 ngx_http_v3_dynamic_table_t *dt; 367 ngx_http_v3_dynamic_table_t *dt;
368 368
369 ngx_log_debug1(NGX_LOG_DEBUG_HTTP, c->log, 0, "http3 duplicate %ui", index); 369 ngx_log_debug1(NGX_LOG_DEBUG_HTTP, c->log, 0, "http3 duplicate %ui", index);
370 370
371 h3c = ngx_http_v3_get_session(c); 371 h3c = ngx_http_v3_get_session(c);
447 ngx_int_t 447 ngx_int_t
448 ngx_http_v3_lookup(ngx_connection_t *c, ngx_uint_t index, ngx_str_t *name, 448 ngx_http_v3_lookup(ngx_connection_t *c, ngx_uint_t index, ngx_str_t *name,
449 ngx_str_t *value) 449 ngx_str_t *value)
450 { 450 {
451 ngx_http_v3_header_t *h; 451 ngx_http_v3_header_t *h;
452 ngx_http_v3_connection_t *h3c; 452 ngx_http_v3_session_t *h3c;
453 ngx_http_v3_dynamic_table_t *dt; 453 ngx_http_v3_dynamic_table_t *dt;
454 454
455 h3c = ngx_http_v3_get_session(c); 455 h3c = ngx_http_v3_get_session(c);
456 dt = &h3c->table; 456 dt = &h3c->table;
457 457
484 ngx_http_v3_decode_insert_count(ngx_connection_t *c, ngx_uint_t *insert_count) 484 ngx_http_v3_decode_insert_count(ngx_connection_t *c, ngx_uint_t *insert_count)
485 { 485 {
486 ngx_uint_t max_entries, full_range, max_value, 486 ngx_uint_t max_entries, full_range, max_value,
487 max_wrapped, req_insert_count; 487 max_wrapped, req_insert_count;
488 ngx_http_v3_srv_conf_t *h3scf; 488 ngx_http_v3_srv_conf_t *h3scf;
489 ngx_http_v3_connection_t *h3c; 489 ngx_http_v3_session_t *h3c;
490 ngx_http_v3_dynamic_table_t *dt; 490 ngx_http_v3_dynamic_table_t *dt;
491 491
492 /* QPACK 4.5.1.1. Required Insert Count */ 492 /* QPACK 4.5.1.1. Required Insert Count */
493 493
494 if (*insert_count == 0) { 494 if (*insert_count == 0) {
537 ngx_http_v3_check_insert_count(ngx_connection_t *c, ngx_uint_t insert_count) 537 ngx_http_v3_check_insert_count(ngx_connection_t *c, ngx_uint_t insert_count)
538 { 538 {
539 size_t n; 539 size_t n;
540 ngx_pool_cleanup_t *cln; 540 ngx_pool_cleanup_t *cln;
541 ngx_http_v3_block_t *block; 541 ngx_http_v3_block_t *block;
542 ngx_http_v3_session_t *h3c;
542 ngx_http_v3_srv_conf_t *h3scf; 543 ngx_http_v3_srv_conf_t *h3scf;
543 ngx_http_v3_connection_t *h3c;
544 ngx_http_v3_dynamic_table_t *dt; 544 ngx_http_v3_dynamic_table_t *dt;
545 545
546 h3c = ngx_http_v3_get_session(c); 546 h3c = ngx_http_v3_get_session(c);
547 dt = &h3c->table; 547 dt = &h3c->table;
548 548
615 615
616 616
617 static ngx_int_t 617 static ngx_int_t
618 ngx_http_v3_new_header(ngx_connection_t *c) 618 ngx_http_v3_new_header(ngx_connection_t *c)
619 { 619 {
620 ngx_queue_t *q; 620 ngx_queue_t *q;
621 ngx_connection_t *bc; 621 ngx_connection_t *bc;
622 ngx_http_v3_block_t *block; 622 ngx_http_v3_block_t *block;
623 ngx_http_v3_connection_t *h3c; 623 ngx_http_v3_session_t *h3c;
624 624
625 h3c = ngx_http_v3_get_session(c); 625 h3c = ngx_http_v3_get_session(c);
626 626
627 ngx_log_debug1(NGX_LOG_DEBUG_HTTP, c->log, 0, 627 ngx_log_debug1(NGX_LOG_DEBUG_HTTP, c->log, 0,
628 "http3 new dynamic header, blocked:%ui", h3c->nblocked); 628 "http3 new dynamic header, blocked:%ui", h3c->nblocked);