Revision: http://svn.php.net/viewvc?view=revision&revision=302912
Log:
- Changed listen.backlog in the FPM configuration file to default to 128
instead of -1 (except on FreeBSD and OpenBSD). This is the same value
as the one used in the cgi sapi. This patch completes revision 302725.
Changed paths:
U php/php-src/branches/PHP_5_3/NEWS
U php/php-src/branches/PHP_5_3/sapi/fpm/fpm/fpm_conf.c
U php/php-src/branches/PHP_5_3/sapi/fpm/fpm/fpm_sockets.h
U php/php-src/branches/PHP_5_3/sapi/fpm/php-fpm.conf.in
U php/php-src/trunk/NEWS
U php/php-src/trunk/sapi/fpm/fpm/fpm_conf.c
U php/php-src/trunk/sapi/fpm/fpm/fpm_sockets.h
U php/php-src/trunk/sapi/fpm/php-fpm.conf.in
Modified: php/php-src/branches/PHP_5_3/NEWS
===================================================================
--- php/php-src/branches/PHP_5_3/NEWS 2010-08-31 08:44:43 UTC (rev 302911)
+++ php/php-src/branches/PHP_5_3/NEWS 2010-08-31 09:33:53 UTC (rev 302912)
@@ -15,6 +15,7 @@
(Kalle)
- Changed the $context parameter on copy() to actually have an effect. (Kalle)
- Fixed possible crash in mssql_fetch_batch(). (Kalle)
+- Fixed inconsistent backlog default value (-1) in FPM on many systems. (fat)
- Fixed bug #52745 (Binding params doesn't work when selecting a date inside a
CASE-WHEN). (Andrey)
Modified: php/php-src/branches/PHP_5_3/sapi/fpm/fpm/fpm_conf.c
===================================================================
--- php/php-src/branches/PHP_5_3/sapi/fpm/fpm/fpm_conf.c 2010-08-31 08:44:43 UTC (rev 302911)
+++ php/php-src/branches/PHP_5_3/sapi/fpm/fpm/fpm_conf.c 2010-08-31 09:33:53 UTC (rev 302912)
@@ -322,7 +322,7 @@
}
memset(wp->config, 0, sizeof(struct fpm_worker_pool_config_s));
- wp->config->listen_backlog = -1;
+ wp->config->listen_backlog = FPM_BACKLOG_DEFAULT;
if (!fpm_worker_all_pools) {
fpm_worker_all_pools = wp;
Modified: php/php-src/branches/PHP_5_3/sapi/fpm/fpm/fpm_sockets.h
===================================================================
--- php/php-src/branches/PHP_5_3/sapi/fpm/fpm/fpm_sockets.h 2010-08-31 08:44:43 UTC (rev 302911)
+++ php/php-src/branches/PHP_5_3/sapi/fpm/fpm/fpm_sockets.h 2010-08-31 09:33:53 UTC (rev 302912)
@@ -10,6 +10,15 @@
#include "fpm_worker_pool.h"
+/*
+ On FreeBSD and OpenBSD, backlog negative values are truncated to SOMAXCONN
+*/
+#if (__FreeBSD__) || (__OpenBSD__)
+#define FPM_BACKLOG_DEFAULT -1
+#else
+#define FPM_BACKLOG_DEFAULT 128
+#endif
+
enum fpm_address_domain fpm_sockets_domain_from_address(char *addr);
int fpm_sockets_init_main();
Modified: php/php-src/branches/PHP_5_3/sapi/fpm/php-fpm.conf.in
===================================================================
--- php/php-src/branches/PHP_5_3/sapi/fpm/php-fpm.conf.in 2010-08-31 08:44:43 UTC (rev 302911)
+++ php/php-src/branches/PHP_5_3/sapi/fpm/php-fpm.conf.in 2010-08-31 09:33:53 UTC (rev 302912)
@@ -75,7 +75,7 @@
listen = 127.0.0.1:9000
; Set listen(2) backlog. A value of '-1' means unlimited.
-; Default Value: -1
+; Default Value: 128 (-1 on FreeBSD and OpenBSD)
;listen.backlog = -1
; List of ipv4 addresses of FastCGI clients which are allowed to connect.
Modified: php/php-src/trunk/NEWS
===================================================================
--- php/php-src/trunk/NEWS 2010-08-31 08:44:43 UTC (rev 302911)
+++ php/php-src/trunk/NEWS 2010-08-31 09:33:53 UTC (rev 302912)
@@ -67,8 +67,6 @@
opcode operands into a separate literal table. (Dmitry)
- Changed session.entropy_file to default to /dev/urandom or /dev/arandom if
either is present at compile time. (Rasmus)
-- Changed listen.backlog in the FPM configuration file to default to 128
- instead of -1 (fat)
- Improved CLI Interactive readline shell (Johannes)
. Added cli.pager ini setting to set a pager for output.
Modified: php/php-src/trunk/sapi/fpm/fpm/fpm_conf.c
===================================================================
--- php/php-src/trunk/sapi/fpm/fpm/fpm_conf.c 2010-08-31 08:44:43 UTC (rev 302911)
+++ php/php-src/trunk/sapi/fpm/fpm/fpm_conf.c 2010-08-31 09:33:53 UTC (rev 302912)
@@ -322,7 +322,7 @@
}
memset(wp->config, 0, sizeof(struct fpm_worker_pool_config_s));
- wp->config->listen_backlog = 128;
+ wp->config->listen_backlog = FPM_BACKLOG_DEFAULT;
if (!fpm_worker_all_pools) {
fpm_worker_all_pools = wp;
Modified: php/php-src/trunk/sapi/fpm/fpm/fpm_sockets.h
===================================================================
--- php/php-src/trunk/sapi/fpm/fpm/fpm_sockets.h 2010-08-31 08:44:43 UTC (rev 302911)
+++ php/php-src/trunk/sapi/fpm/fpm/fpm_sockets.h 2010-08-31 09:33:53 UTC (rev 302912)
@@ -10,6 +10,15 @@
#include "fpm_worker_pool.h"
+/*
+ On FreeBSD and OpenBSD, backlog negative values are truncated to SOMAXCONN
+*/
+#if (__FreeBSD__) || (__OpenBSD__)
+#define FPM_BACKLOG_DEFAULT -1
+#else
+#define FPM_BACKLOG_DEFAULT 128
+#endif
+
enum fpm_address_domain fpm_sockets_domain_from_address(char *addr);
int fpm_sockets_init_main();
Modified: php/php-src/trunk/sapi/fpm/php-fpm.conf.in
===================================================================
--- php/php-src/trunk/sapi/fpm/php-fpm.conf.in 2010-08-31 08:44:43 UTC (rev 302911)
+++ php/php-src/trunk/sapi/fpm/php-fpm.conf.in 2010-08-31 09:33:53 UTC (rev 302912)
@@ -75,7 +75,7 @@
listen = 127.0.0.1:9000
; Set listen(2) backlog.
-; Default Value: 128
+; Default Value: 128 (-1 on FreeBSD and OpenBSD)
;listen.backlog = 128
; List of ipv4 addresses of FastCGI clients which are allowed to connect.