Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 04 May 2026 16:09:22 +0000
From:      Jochen Neumeister <joneum@FreeBSD.org>
To:        ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org
Subject:   git: ec4aac13a632 - main - www/nginx: fix round_robin patch for nginx 1.30.0
Message-ID:  <69f8c4b2.21d6d.29b28977@gitrepo.freebsd.org>

index | next in thread | raw e-mail

The branch main has been updated by joneum:

URL: https://cgit.FreeBSD.org/ports/commit/?id=ec4aac13a6322ada6fd61f6b7df290f3236295c9

commit ec4aac13a6322ada6fd61f6b7df290f3236295c9
Author:     Jochen Neumeister <joneum@FreeBSD.org>
AuthorDate: 2026-05-04 16:07:46 +0000
Commit:     Jochen Neumeister <joneum@FreeBSD.org>
CommitDate: 2026-05-04 16:09:13 +0000

    www/nginx: fix round_robin patch for nginx 1.30.0
    
    Refresh patch context to match upstream changes so it
    applies cleanly again. Restores NGX_HTTP_UPSTREAM_CHECK support.
    
    PR:     294994
    Sponsored by:   Netzkommune GmbH
---
 ...-patch-src-http-ngx_http_upstream_round_robin.c | 115 ++++++++++++++-------
 1 file changed, 76 insertions(+), 39 deletions(-)

diff --git a/www/nginx/files/extra-patch-src-http-ngx_http_upstream_round_robin.c b/www/nginx/files/extra-patch-src-http-ngx_http_upstream_round_robin.c
index e5012b098309..b2588f7a9ff4 100644
--- a/www/nginx/files/extra-patch-src-http-ngx_http_upstream_round_robin.c
+++ b/www/nginx/files/extra-patch-src-http-ngx_http_upstream_round_robin.c
@@ -1,50 +1,86 @@
---- src/http/ngx_http_upstream_round_robin.c.orig	2016-02-24 14:53:24 UTC
-+++ src/http/ngx_http_upstream_round_robin.c
-@@ -9,6 +9,9 @@
- #include <ngx_core.h>
+--- src/http/ngx_http_upstream_round_robin.c.orig
++++ src/http/ngx_http_upstream_round_robin.c	2026-05-04 16:03:21.659464946 +0000
+@@ -10,6 +10,10 @@
  #include <ngx_http.h>
+ #include <ngx_md5.h>
  
 +#if (NGX_HTTP_UPSTREAM_CHECK)
 +#include "ngx_http_upstream_check_module.h"
 +#endif
++
  
- #define ngx_http_upstream_tries(p) ((p)->number                               \
-                                     + ((p)->next ? (p)->next->number : 0))
-@@ -96,7 +99,14 @@ ngx_http_upstream_init_round_robin(ngx_c
-                 peer[n].fail_timeout = server[i].fail_timeout;
+ #define ngx_http_upstream_tries(p) ((p)->tries                                \
+                                     + ((p)->next ? (p)->next->tries : 0))
+@@ -196,6 +200,16 @@
+                 peer[n].down = server[i].down;
+                 peer[n].server = server[i].name;
+ 
++#if (NGX_HTTP_UPSTREAM_CHECK)
++                if (!server[i].down) {
++                    peer[n].check_index =
++                        ngx_http_upstream_check_add_peer(cf, us,
++                                                         &server[i].addrs[0]);
++                } else {
++                    peer[n].check_index = (ngx_uint_t) NGX_ERROR;
++                }
++#endif
++
+ #if (NGX_HTTP_UPSTREAM_SID)
+                 if (ngx_http_upstream_create_sid(cf, &peer[n], &server[i].sid)
+                     != NGX_OK)
+@@ -225,6 +239,16 @@
                  peer[n].down = server[i].down;
                  peer[n].server = server[i].name;
--
+ 
 +#if (NGX_HTTP_UPSTREAM_CHECK)
 +                if (!server[i].down) {
 +                    peer[n].check_index =
-+                        ngx_http_upstream_check_add_peer(cf, us, &server[i].addrs[j]);
++                        ngx_http_upstream_check_add_peer(cf, us,
++                                                         &server[i].addrs[j]);
 +                } else {
 +                    peer[n].check_index = (ngx_uint_t) NGX_ERROR;
 +                }
 +#endif
-                 *peerp = &peer[n];
-                 peerp = &peer[n].next;
-                 n++;
-@@ -159,7 +169,15 @@ ngx_http_upstream_init_round_robin(ngx_c
-                 peer[n].fail_timeout = server[i].fail_timeout;
++
+ #if (NGX_HTTP_UPSTREAM_SID)
+                 if (ngx_http_upstream_create_sid(cf, &peer[n], &server[i].sid)
+                     != NGX_OK)
+@@ -338,6 +362,16 @@
                  peer[n].down = server[i].down;
                  peer[n].server = server[i].name;
--
+ 
 +#if (NGX_HTTP_UPSTREAM_CHECK)
 +                if (!server[i].down) {
 +                    peer[n].check_index =
-+                        ngx_http_upstream_check_add_peer(cf, us, &server[i].addrs[j]);
++                        ngx_http_upstream_check_add_peer(cf, us,
++                                                         &server[i].addrs[0]);
++                } else {
++                    peer[n].check_index = (ngx_uint_t) NGX_ERROR;
 +                }
-+                else {
++#endif
++
+ #if (NGX_HTTP_UPSTREAM_SID)
+                 if (ngx_http_upstream_create_sid(cf, &peer[n], &server[i].sid)
+                     != NGX_OK)
+@@ -367,6 +401,16 @@
+                 peer[n].down = server[i].down;
+                 peer[n].server = server[i].name;
+ 
++#if (NGX_HTTP_UPSTREAM_CHECK)
++                if (!server[i].down) {
++                    peer[n].check_index =
++                        ngx_http_upstream_check_add_peer(cf, us,
++                                                         &server[i].addrs[j]);
++                } else {
 +                    peer[n].check_index = (ngx_uint_t) NGX_ERROR;
 +                }
 +#endif
-                 *peerp = &peer[n];
-                 peerp = &peer[n].next;
-                 n++;
-@@ -225,6 +243,9 @@ ngx_http_upstream_init_round_robin(ngx_c
-         peer[i].current_weight = 0;
++
+ #if (NGX_HTTP_UPSTREAM_SID)
+                 if (ngx_http_upstream_create_sid(cf, &peer[n], &server[i].sid)
+                     != NGX_OK)
+@@ -442,6 +486,9 @@
+         peer[i].max_conns = 0;
          peer[i].max_fails = 1;
          peer[i].fail_timeout = 10;
 +#if (NGX_HTTP_UPSTREAM_CHECK)
@@ -53,8 +89,8 @@
          *peerp = &peer[i];
          peerp = &peer[i].next;
      }
-@@ -339,6 +360,9 @@ ngx_http_upstream_create_round_robin_pee
-         peer[0].current_weight = 0;
+@@ -624,6 +671,9 @@
+         peer[0].max_conns = 0;
          peer[0].max_fails = 1;
          peer[0].fail_timeout = 10;
 +#if (NGX_HTTP_UPSTREAM_CHECK)
@@ -63,8 +99,8 @@
          peers->peer = peer;
  
      } else {
-@@ -381,6 +405,9 @@ ngx_http_upstream_create_round_robin_pee
-             peer[i].current_weight = 0;
+@@ -658,6 +708,9 @@
+             peer[i].max_conns = 0;
              peer[i].max_fails = 1;
              peer[i].fail_timeout = 10;
 +#if (NGX_HTTP_UPSTREAM_CHECK)
@@ -73,20 +109,20 @@
              *peerp = &peer[i];
              peerp = &peer[i].next;
          }
-@@ -441,6 +468,12 @@ ngx_http_upstream_get_round_robin_peer(n
-             goto failed;
-         }
- 
+@@ -733,6 +786,12 @@
+             if (peer->max_conns && peer->conns >= peer->max_conns) {
+                 goto failed;
+             }
++
 +#if (NGX_HTTP_UPSTREAM_CHECK)
-+        if (ngx_http_upstream_check_peer_down(peer->check_index)) {
-+            goto failed;
-+        }
++            if (ngx_http_upstream_check_peer_down(peer->check_index)) {
++                goto failed;
++            }
 +#endif
-+
-         rrp->current = peer;
- 
-     } else {
-@@ -542,6 +575,12 @@ ngx_http_upstream_get_peer(ngx_http_upst
+ #if (NGX_HTTP_UPSTREAM_SID)
+         }
+ #endif
+@@ -870,6 +929,12 @@
              continue;
          }
  
@@ -99,3 +135,4 @@
          if (peer->max_fails
              && peer->fails >= peer->max_fails
              && now - peer->checked <= peer->fail_timeout)
+


home | help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?69f8c4b2.21d6d.29b28977>