diff src/event/quic/ngx_event_quic_output.c @ 8815:8ab0d609af09 quic

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).
author Vladimir Homutov <vl@nginx.com>
date Tue, 20 Jul 2021 12:37:12 +0300
parents bb5152ed045b
children ad046179eb91
line wrap: on
line diff
--- 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_connecti
     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;