File: drop-default-port.patch

package info (click to toggle)
libnginx-mod-http-upstream-fair 1%3A0.0~git20120408.a18b409-6
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 228 kB
  • sloc: ansic: 2,972; sh: 53; makefile: 3
file content (37 lines) | stat: -rw-r--r-- 1,445 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
From d754c97abc103f6cb3c4d9385daa8547245a07e6 Mon Sep 17 00:00:00 2001
From: Christos Trochalakis <yatiohi@ideopolis.gr>
Date: Wed, 16 Nov 2016 10:52:08 +0200
Subject: [PATCH] Don't use default_port (dropped in nginx 1.11.6)

See:
4dea01cf49e8 Upstream: removed ngx_http_upstream_srv_conf_t.default_port.
3fa5983b6b44 Upstream: don't consider default_port when matching upstreams.
---
 ngx_http_upstream_fair_module.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/ngx_http_upstream_fair_module.c b/ngx_http_upstream_fair_module.c
index a4419ca..5d76bb4 100644
--- a/ngx_http_upstream_fair_module.c
+++ b/ngx_http_upstream_fair_module.c
@@ -540,7 +540,7 @@ ngx_http_upstream_init_fair_rr(ngx_conf_t *cf, ngx_http_upstream_srv_conf_t *us)
 
     /* an upstream implicitly defined by proxy_pass, etc. */
 
-    if (us->port == 0 && us->default_port == 0) {
+    if (us->port == 0) {
         ngx_log_error(NGX_LOG_EMERG, cf->log, 0,
                       "no port in upstream \"%V\" in %s:%ui",
                       &us->host, us->file_name, us->line);
@@ -550,7 +550,7 @@ ngx_http_upstream_init_fair_rr(ngx_conf_t *cf, ngx_http_upstream_srv_conf_t *us)
     ngx_memzero(&u, sizeof(ngx_url_t));
 
     u.host = us->host;
-    u.port = (in_port_t) (us->port ? us->port : us->default_port);
+    u.port = (in_port_t) us->port;
 
     if (ngx_inet_resolve_host(cf->pool, &u) != NGX_OK) {
         if (u.err) {
-- 
2.10.2