Skip to content

Commit 026b2c7

Browse files
author
Andrey Alcheev
committed
Port number must be always initialized otherwise it becomes zero in case of using unix socket without "port=" parameter
1 parent dc3d3bb commit 026b2c7

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

Diff for: src/ngx_postgres_module.c

+1-2
Original file line numberDiff line numberDiff line change
@@ -442,8 +442,7 @@ ngx_postgres_conf_server(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
442442

443443
pgs->addrs = u.addrs;
444444
pgs->naddrs = u.naddrs;
445-
if(u.family != AF_UNIX)
446-
pgs->port = u.port;
445+
pgs->port = u.family == AF_UNIX ? u.default_port : u.port;
447446
pgs->family = u.family;
448447

449448
/* parse various options */

0 commit comments

Comments
 (0)