summaryrefslogtreecommitdiffstats
path: root/php-bug68423.patch
diff options
context:
space:
mode:
authorRemi Collet <fedora@famillecollet.com>2014-11-16 10:01:56 +0100
committerRemi Collet <fedora@famillecollet.com>2014-11-16 10:01:56 +0100
commitad241fb72e7217f95c8368b635f8b1a5d53271d5 (patch)
tree2b1664caa5caf53121803c7e598842234e6d9a28 /php-bug68423.patch
parent20c65a501d2a0b52397919fbd1b07f0418f1bbb9 (diff)
PHP 5.5.19 + upstream patches for php-fpm
Diffstat (limited to 'php-bug68423.patch')
-rw-r--r--php-bug68423.patch55
1 files changed, 55 insertions, 0 deletions
diff --git a/php-bug68423.patch b/php-bug68423.patch
new file mode 100644
index 0000000..34ba57a
--- /dev/null
+++ b/php-bug68423.patch
@@ -0,0 +1,55 @@
+From 23db11976889c3600cf7853fe0fd687a1c9435e6 Mon Sep 17 00:00:00 2001
+From: Remi Collet <remi@php.net>
+Date: Fri, 14 Nov 2014 17:29:31 +0100
+Subject: [PATCH] Fix bug #68423i PHP-FPM will no longer load all pools
+
+The hash need to be unique per IP + Port
+Previous version have (IPv4 only)
+ sprintf(key, "%u.%u.%u.%u:%u", IPQUAD(&sa_in->sin_addr), (unsigned int) ntohs(sa_in->sin_port));
+---
+ sapi/fpm/fpm/fpm_sockets.c | 17 ++++++++++++++---
+ 1 file changed, 14 insertions(+), 3 deletions(-)
+
+diff --git a/sapi/fpm/fpm/fpm_sockets.c b/sapi/fpm/fpm/fpm_sockets.c
+index da14d63..3e4f09c 100644
+--- a/sapi/fpm/fpm/fpm_sockets.c
++++ b/sapi/fpm/fpm/fpm_sockets.c
+@@ -85,13 +85,24 @@ static void *fpm_get_in_addr(struct sockaddr *sa) /* {{{ */
+ }
+ /* }}} */
+
++static int fpm_get_in_port(struct sockaddr *sa) /* {{{ */
++{
++ if (sa->sa_family == AF_INET) {
++ return ntohs(((struct sockaddr_in*)sa)->sin_port);
++ }
++
++ return ntohs(((struct sockaddr_in6*)sa)->sin6_port);
++}
++/* }}} */
++
+ static int fpm_sockets_hash_op(int sock, struct sockaddr *sa, char *key, int type, int op) /* {{{ */
+ {
+ if (key == NULL) {
+ switch (type) {
+ case FPM_AF_INET : {
+- key = alloca(INET6_ADDRSTRLEN);
+- inet_ntop(sa->sa_family, fpm_get_in_addr(sa), key, sizeof key);
++ key = alloca(INET6_ADDRSTRLEN+10);
++ inet_ntop(sa->sa_family, fpm_get_in_addr(sa), key, INET6_ADDRSTRLEN);
++ sprintf(key+strlen(key), ":%d", fpm_get_in_port(sa));
+ break;
+ }
+
+@@ -246,7 +257,7 @@ static int fpm_socket_af_inet_listening_socket(struct fpm_worker_pool_s *wp) /*
+ char *addr = NULL;
+ int addr_len;
+ int port = 0;
+- int sock;
++ int sock = -1;
+ int status;
+
+ if (port_str) { /* this is host:port pair */
+--
+2.1.0
+