]> git.kaiwu.me - nginx.git/commitdiff
Stream: moved fastopen compatibility check.
authorRoman Arutyunyan <arut@nginx.com>
Thu, 18 Jan 2024 15:12:38 +0000 (19:12 +0400)
committerRoman Arutyunyan <arut@nginx.com>
Thu, 18 Jan 2024 15:12:38 +0000 (19:12 +0400)
The move makes the code look similar to the corresponding code in http module.

src/stream/ngx_stream_core_module.c

index 576a2fb160ee26e161c9fb75a01f274125a3cbe3..3093963b7df20193b4033e64582de26ad3c641cd 100644 (file)
@@ -1215,6 +1215,12 @@ ngx_stream_core_listen(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
     }
 
     if (lsopt.type == SOCK_DGRAM) {
+#if (NGX_HAVE_TCP_FASTOPEN)
+        if (lsopt.fastopen != -1) {
+            return "\"fastopen\" parameter is incompatible with \"udp\"";
+        }
+#endif
+
         if (backlog) {
             return "\"backlog\" parameter is incompatible with \"udp\"";
         }
@@ -1244,12 +1250,6 @@ ngx_stream_core_listen(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
         if (lsopt.proxy_protocol) {
             return "\"proxy_protocol\" parameter is incompatible with \"udp\"";
         }
-
-#if (NGX_HAVE_TCP_FASTOPEN)
-        if (lsopt.fastopen != -1) {
-            return "\"fastopen\" parameter is incompatible with \"udp\"";
-        }
-#endif
     }
 
     for (n = 0; n < u.naddrs; n++) {