- Fixed bug #61026 (FPM pools can listen on the same address)

This commit is contained in:
Jerome Loyet 2012-05-23 11:53:04 +02:00
parent d236c1af8a
commit 1299503936
2 changed files with 16 additions and 1 deletions

1
NEWS
View File

@ -60,6 +60,7 @@ PHP NEWS
. Fixed bug #61295 (php-fpm should not fail with commented 'user'
for non-root start). (fat)
. Fixed bug #61839 (Unable to cross-compile PHP with --enable-fpm). (fat)
. Fixed bug #61026 (FPM pools can listen on the same address). (fat)
- Libxml:
. Fixed bug #61617 (Libxml tests failed(ht is already destroyed)).

View File

@ -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;
}
/* }}} */