Welcome! Log In Create A New Profile

Advanced

[PATCH 1 of 5] HTTP/3: removed client-side encoder support

Roman Arutyunyan
October 07, 2021 07:38AM
# HG changeset patch
# User Roman Arutyunyan <arut@nginx.com>
# Date 1633520939 -10800
# Wed Oct 06 14:48:59 2021 +0300
# Branch quic
# Node ID d53039c3224e8227979c113f621e532aef7c0f9b
# Parent 1ead7d64e9934c1a6c0d9dd3c5f1a3d643b926d6
HTTP/3: removed client-side encoder support.

Dynamic tables are not used when generating responses anyway.

diff --git a/src/http/v3/ngx_http_v3_streams.c b/src/http/v3/ngx_http_v3_streams.c
--- a/src/http/v3/ngx_http_v3_streams.c
+++ b/src/http/v3/ngx_http_v3_streams.c
@@ -480,155 +480,6 @@ failed:


ngx_int_t
-ngx_http_v3_send_ref_insert(ngx_connection_t *c, ngx_uint_t dynamic,
- ngx_uint_t index, ngx_str_t *value)
-{
- u_char *p, buf[NGX_HTTP_V3_PREFIX_INT_LEN * 2];
- size_t n;
- ngx_connection_t *ec;
-
- ngx_log_debug3(NGX_LOG_DEBUG_HTTP, c->log, 0,
- "http3 client ref insert, %s[%ui] \"%V\"",
- dynamic ? "dynamic" : "static", index, value);
-
- ec = ngx_http_v3_get_uni_stream(c, NGX_HTTP_V3_STREAM_ENCODER);
- if (ec == NULL) {
- return NGX_ERROR;
- }
-
- p = buf;
-
- *p = (dynamic ? 0x80 : 0xc0);
- p = (u_char *) ngx_http_v3_encode_prefix_int(p, index, 6);
-
- /* XXX option for huffman? */
- *p = 0;
- p = (u_char *) ngx_http_v3_encode_prefix_int(p, value->len, 7);
-
- n = p - buf;
-
- if (ec->send(ec, buf, n) != (ssize_t) n) {
- goto failed;
- }
-
- if (ec->send(ec, value->data, value->len) != (ssize_t) value->len) {
- goto failed;
- }
-
- return NGX_OK;
-
-failed:
-
- ngx_http_v3_close_uni_stream(ec);
-
- return NGX_ERROR;
-}
-
-
-ngx_int_t
-ngx_http_v3_send_insert(ngx_connection_t *c, ngx_str_t *name, ngx_str_t *value)
-{
- u_char buf[NGX_HTTP_V3_PREFIX_INT_LEN];
- size_t n;
- ngx_connection_t *ec;
-
- ngx_log_debug2(NGX_LOG_DEBUG_HTTP, c->log, 0,
- "http3 client insert \"%V\":\"%V\"", name, value);
-
- ec = ngx_http_v3_get_uni_stream(c, NGX_HTTP_V3_STREAM_ENCODER);
- if (ec == NULL) {
- return NGX_ERROR;
- }
-
- /* XXX option for huffman? */
- buf[0] = 0x40;
- n = (u_char *) ngx_http_v3_encode_prefix_int(buf, name->len, 5) - buf;
-
- if (ec->send(ec, buf, n) != (ssize_t) n) {
- goto failed;
- }
-
- if (ec->send(ec, name->data, name->len) != (ssize_t) name->len) {
- goto failed;
- }
-
- /* XXX option for huffman? */
- buf[0] = 0;
- n = (u_char *) ngx_http_v3_encode_prefix_int(buf, value->len, 7) - buf;
-
- if (ec->send(ec, buf, n) != (ssize_t) n) {
- goto failed;
- }
-
- if (ec->send(ec, value->data, value->len) != (ssize_t) value->len) {
- goto failed;
- }
-
- return NGX_OK;
-
-failed:
-
- ngx_http_v3_close_uni_stream(ec);
-
- return NGX_ERROR;
-}
-
-
-ngx_int_t
-ngx_http_v3_send_set_capacity(ngx_connection_t *c, ngx_uint_t capacity)
-{
- u_char buf[NGX_HTTP_V3_PREFIX_INT_LEN];
- size_t n;
- ngx_connection_t *ec;
-
- ngx_log_debug1(NGX_LOG_DEBUG_HTTP, c->log, 0,
- "http3 client set capacity %ui", capacity);
-
- ec = ngx_http_v3_get_uni_stream(c, NGX_HTTP_V3_STREAM_ENCODER);
- if (ec == NULL) {
- return NGX_ERROR;
- }
-
- buf[0] = 0x20;
- n = (u_char *) ngx_http_v3_encode_prefix_int(buf, capacity, 5) - buf;
-
- if (ec->send(ec, buf, n) != (ssize_t) n) {
- ngx_http_v3_close_uni_stream(ec);
- return NGX_ERROR;
- }
-
- return NGX_OK;
-}
-
-
-ngx_int_t
-ngx_http_v3_send_duplicate(ngx_connection_t *c, ngx_uint_t index)
-{
- u_char buf[NGX_HTTP_V3_PREFIX_INT_LEN];
- size_t n;
- ngx_connection_t *ec;
-
- ngx_log_debug1(NGX_LOG_DEBUG_HTTP, c->log, 0,
- "http3 client duplicate %ui", index);
-
- ec = ngx_http_v3_get_uni_stream(c, NGX_HTTP_V3_STREAM_ENCODER);
- if (ec == NULL) {
- return NGX_ERROR;
- }
-
- buf[0] = 0;
- n = (u_char *) ngx_http_v3_encode_prefix_int(buf, index, 5) - buf;
-
- if (ec->send(ec, buf, n) != (ssize_t) n) {
- ngx_http_v3_close_uni_stream(ec);
- return NGX_ERROR;
- }
-
- return NGX_OK;
-}
-
-
-ngx_int_t
ngx_http_v3_send_ack_section(ngx_connection_t *c, ngx_uint_t stream_id)
{
u_char buf[NGX_HTTP_V3_PREFIX_INT_LEN];
diff --git a/src/http/v3/ngx_http_v3_streams.h b/src/http/v3/ngx_http_v3_streams.h
--- a/src/http/v3/ngx_http_v3_streams.h
+++ b/src/http/v3/ngx_http_v3_streams.h
@@ -27,13 +27,6 @@ ngx_int_t ngx_http_v3_cancel_stream(ngx_

ngx_int_t ngx_http_v3_send_settings(ngx_connection_t *c);
ngx_int_t ngx_http_v3_send_goaway(ngx_connection_t *c, uint64_t id);
-ngx_int_t ngx_http_v3_send_ref_insert(ngx_connection_t *c, ngx_uint_t dynamic,
- ngx_uint_t index, ngx_str_t *value);
-ngx_int_t ngx_http_v3_send_insert(ngx_connection_t *c, ngx_str_t *name,
- ngx_str_t *value);
-ngx_int_t ngx_http_v3_send_set_capacity(ngx_connection_t *c,
- ngx_uint_t capacity);
-ngx_int_t ngx_http_v3_send_duplicate(ngx_connection_t *c, ngx_uint_t index);
ngx_int_t ngx_http_v3_send_ack_section(ngx_connection_t *c,
ngx_uint_t stream_id);
ngx_int_t ngx_http_v3_send_cancel_stream(ngx_connection_t *c,
_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

[PATCH 0 of 5] QUIC flood detection

Roman Arutyunyan 358 October 07, 2021 07:38AM

[PATCH 1 of 5] HTTP/3: removed client-side encoder support

Roman Arutyunyan 105 October 07, 2021 07:38AM

Re: [PATCH 1 of 5] HTTP/3: removed client-side encoder support

Vladimir Homutov 84 October 12, 2021 08:46AM

[PATCH 2 of 5] HTTP/3: fixed request length calculation

Roman Arutyunyan 126 October 07, 2021 07:38AM

Re: [PATCH 2 of 5] HTTP/3: fixed request length calculation

Vladimir Homutov 110 October 12, 2021 08:48AM

[PATCH 3 of 5] HTTP/3: traffic-based flood detection

Roman Arutyunyan 135 October 07, 2021 07:38AM

Re: [PATCH 3 of 5] HTTP/3: traffic-based flood detection

Vladimir Homutov 109 October 13, 2021 05:08AM

Re: [PATCH 3 of 5] HTTP/3: traffic-based flood detection

Roman Arutyunyan 106 October 13, 2021 07:38AM

[PATCH 4 of 5] QUIC: traffic-based flood detection

Roman Arutyunyan 182 October 07, 2021 07:38AM

Re: [PATCH 4 of 5] QUIC: traffic-based flood detection

Vladimir Homutov 212 October 12, 2021 08:40AM

Re: [PATCH 4 of 5] QUIC: traffic-based flood detection

Roman Arutyunyan 100 October 13, 2021 07:42AM

[PATCH 5 of 5] QUIC: limited the total number of frames

Roman Arutyunyan 100 October 07, 2021 07:38AM

Re: [PATCH 5 of 5] QUIC: limited the total number of frames

Vladimir Homutov 92 October 12, 2021 08:44AM

Re: [PATCH 5 of 5] QUIC: limited the total number of frames

Roman Arutyunyan 146 October 13, 2021 07:54AM

Re: [PATCH 0 of 5] QUIC flood detection

Roman Arutyunyan 225 October 07, 2021 07:46AM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 185
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready