summaryrefslogtreecommitdiffhomepage
path: root/src/event
diff options
context:
space:
mode:
authorVladimir Homutov <vl@nginx.com>2021-07-20 12:37:12 +0300
committerVladimir Homutov <vl@nginx.com>2021-07-20 12:37:12 +0300
commit6157d0b5c1b3a6be7928748df2cda19838889f4f (patch)
treea0aa60c1d01a0ae07299dce0b67ad6dd186d90d8 /src/event
parent31fe966e719c8fb0273119476b0c9a86d3f8e1b2 (diff)
downloadnginx-6157d0b5c1b3a6be7928748df2cda19838889f4f.tar.gz
nginx-6157d0b5c1b3a6be7928748df2cda19838889f4f.tar.bz2
QUIC: the "quic_gso" directive.
The directive enables usage of UDP segmentation offloading by quic. By default, gso is disabled since it is not always operational when detected (depends on interface configuration).
Diffstat (limited to 'src/event')
-rw-r--r--src/event/quic/ngx_event_quic.h1
-rw-r--r--src/event/quic/ngx_event_quic_output.c8
2 files changed, 7 insertions, 2 deletions
diff --git a/src/event/quic/ngx_event_quic.h b/src/event/quic/ngx_event_quic.h
index fe0f7fef3..d3429cbe4 100644
--- a/src/event/quic/ngx_event_quic.h
+++ b/src/event/quic/ngx_event_quic.h
@@ -59,6 +59,7 @@ typedef struct {
ngx_ssl_t *ssl;
ngx_quic_tp_t tp;
ngx_flag_t retry;
+ ngx_flag_t gso_enabled;
ngx_flag_t require_alpn;
ngx_str_t host_key;
u_char av_token_key[NGX_QUIC_AV_KEY_LEN];
diff --git a/src/event/quic/ngx_event_quic_output.c b/src/event/quic/ngx_event_quic_output.c
index ce3805c8f..dc4cf59be 100644
--- a/src/event/quic/ngx_event_quic_output.c
+++ b/src/event/quic/ngx_event_quic_output.c
@@ -212,13 +212,17 @@ ngx_quic_allow_segmentation(ngx_connection_t *c, ngx_quic_socket_t *qsock)
ngx_quic_send_ctx_t *ctx;
ngx_quic_connection_t *qc;
+ qc = ngx_quic_get_connection(c);
+
+ if (!qc->conf->gso_enabled) {
+ return 0;
+ }
+
if (qsock->path->state != NGX_QUIC_PATH_VALIDATED) {
/* don't even try to be faster on non-validated paths */
return 0;
}
- qc = ngx_quic_get_connection(c);
-
ctx = ngx_quic_get_send_ctx(qc, ssl_encryption_initial);
if (!ngx_queue_empty(&ctx->frames)) {
return 0;