Skip to content

Commit 2a98570

Browse files
committed
More accurate build fix with nginx 1.11.6+
1 parent 4ae394a commit 2a98570

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/ngx_postgres_module.c

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1314,13 +1314,22 @@ ngx_postgres_find_upstream(ngx_http_request_t *r, ngx_url_t *url)
13141314
dd("host doesn't match");
13151315
continue;
13161316
}
1317-
1317+
1318+
#if (nginx_version < 1011006)
13181319
if (uscfp[i]->port != url->port) {
13191320
dd("port doesn't match: %d != %d",
13201321
(int) uscfp[i]->port, (int) url->port);
13211322
continue;
13221323
}
13231324

1325+
if (uscfp[i]->default_port && url->default_port
1326+
&& (uscfp[i]->default_port != url->default_port))
1327+
{
1328+
dd("default_port doesn't match");
1329+
continue;
1330+
}
1331+
1332+
#endif
13241333
dd("returning");
13251334
return uscfp[i];
13261335
}

0 commit comments

Comments
 (0)