]> granicus.if.org Git - php/commitdiff
- Changed listen.backlog in the FPM configuration file to default to 128
authorJérôme Loyet <fat@php.net>
Tue, 31 Aug 2010 09:33:53 +0000 (09:33 +0000)
committerJérôme Loyet <fat@php.net>
Tue, 31 Aug 2010 09:33:53 +0000 (09:33 +0000)
  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.

NEWS
sapi/fpm/fpm/fpm_conf.c
sapi/fpm/fpm/fpm_sockets.h
sapi/fpm/php-fpm.conf.in

diff --git a/NEWS b/NEWS
index 6a5a47a2374864fa03283984f9e5abbaeb3901ec..e0d9f31310f11fa5fe92f16b3027f3e66a881900 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -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.
index 2a20d9d9f9cda537042e3b4f42b019eaa1aaa2f0..4c7e6d618cf04290bc18ff76e09d3bb7a208d57f 100644 (file)
@@ -322,7 +322,7 @@ static void *fpm_worker_pool_config_alloc() /* {{{ */
        }
 
        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;
index d9e283d5a3271a2bdca2be5b3d05ae7bebc0ab17..8bd778ea5078f871b8c89491582874a0e14bedf9 100644 (file)
 
 #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();
 
index 6d02f0996bb5c7dd0965678aad7688849c678894..d3bc7eacd75dc532a706cfe4271af719e65c54fb 100644 (file)
@@ -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.