summaryrefslogtreecommitdiff
path: root/sapi
diff options
context:
space:
mode:
authorJerome Loyet <fat@php.net>2012-05-23 09:53:04 (GMT)
committerJerome Loyet <fat@php.net>2012-05-23 09:53:04 (GMT)
commit1299503936597ea873a3eb8272aa4deec2f31e5b (patch)
tree9ec886bfda710a6467fe75f3b592918ab32517e6 /sapi
parentd236c1af8a5e1813e2667de969fa2ad39da74887 (diff)
downloadphp-1299503936597ea873a3eb8272aa4deec2f31e5b.tar.gz
- Fixed bug #61026 (FPM pools can listen on the same address)
Diffstat (limited to 'sapi')
-rw-r--r--sapi/fpm/fpm/fpm_conf.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/sapi/fpm/fpm/fpm_conf.c b/sapi/fpm/fpm/fpm_conf.c
index 0b2c5ae..a4283a2 100644
--- a/sapi/fpm/fpm/fpm_conf.c
+++ b/sapi/fpm/fpm/fpm_conf.c
@@ -704,7 +704,7 @@ static int fpm_evaluate_full_path(char **path, struct fpm_worker_pool_s *wp, cha
static int fpm_conf_process_all_pools() /* {{{ */
{
- struct fpm_worker_pool_s *wp;
+ struct fpm_worker_pool_s *wp, *wp2;
if (!fpm_worker_all_pools) {
zlog(ZLOG_ERROR, "No pool defined. at least one pool section must be specified in config file");
@@ -1044,6 +1044,20 @@ static int fpm_conf_process_all_pools() /* {{{ */
}
}
}
+
+ /* ensure 2 pools do not use the same listening address */
+ for (wp = fpm_worker_all_pools; wp; wp = wp->next) {
+ for (wp2 = fpm_worker_all_pools; wp2; wp2 = wp2->next) {
+ if (wp == wp2) {
+ continue;
+ }
+
+ if (wp->config->listen_address && *wp->config->listen_address && wp2->config->listen_address && *wp2->config->listen_address && !strcmp(wp->config->listen_address, wp2->config->listen_address)) {
+ zlog(ZLOG_ERROR, "[pool %s] unable to set listen address as it's already used in another pool '%s'", wp2->config->name, wp->config->name);
+ return -1;
+ }
+ }
+ }
return 0;
}
/* }}} */