summaryrefslogtreecommitdiff
path: root/sapi
diff options
context:
space:
mode:
Diffstat (limited to 'sapi')
-rw-r--r--sapi/cgi/cgi_main.c27
-rw-r--r--sapi/cli/php_cli_server.c1
-rw-r--r--sapi/fpm/fpm/fastcgi.c5
-rw-r--r--sapi/fpm/fpm/fpm_children.c2
-rw-r--r--sapi/fpm/fpm/fpm_sockets.c1
-rw-r--r--sapi/fpm/fpm/fpm_sockets.h2
-rw-r--r--sapi/fpm/php-fpm.8.in2
-rw-r--r--sapi/fpm/php-fpm.conf.in4
8 files changed, 15 insertions, 29 deletions
diff --git a/sapi/cgi/cgi_main.c b/sapi/cgi/cgi_main.c
index 4f3d5040e1..4c78fcafec 100644
--- a/sapi/cgi/cgi_main.c
+++ b/sapi/cgi/cgi_main.c
@@ -154,7 +154,6 @@ static const opt_struct OPTIONS[] = {
{'?', 0, "usage"},/* help alias (both '?' and 'usage') */
{'v', 0, "version"},
{'z', 1, "zend-extension"},
- {'W', 1, "warmup"},
{'T', 1, "timing"},
{'-', 0, NULL} /* end of args */
};
@@ -1755,7 +1754,6 @@ int main(int argc, char *argv[])
int fcgi_fd = 0;
fcgi_request *request = NULL;
int repeats = 1;
- int warmup_repeats = 0;
int benchmark = 0;
#if HAVE_GETTIMEOFDAY
struct timeval start, end;
@@ -2105,9 +2103,6 @@ consult the installation file that came with this distribution, or visit \n\
time(&start);
#endif
break;
- case 'W':
- warmup_repeats = atoi(php_optarg);
- break;
case 'h':
case '?':
if (request) {
@@ -2521,24 +2516,12 @@ fastcgi_request_done:
if (!fastcgi) {
if (benchmark) {
- if (warmup_repeats) {
- warmup_repeats--;
- if (!warmup_repeats) {
-#ifdef HAVE_GETTIMEOFDAY
- gettimeofday(&start, NULL);
-#else
- time(&start);
-#endif
- }
+ repeats--;
+ if (repeats > 0) {
+ script_file = NULL;
+ php_optind = orig_optind;
+ php_optarg = orig_optarg;
continue;
- } else {
- repeats--;
- if (repeats > 0) {
- script_file = NULL;
- php_optind = orig_optind;
- php_optarg = orig_optarg;
- continue;
- }
}
}
break;
diff --git a/sapi/cli/php_cli_server.c b/sapi/cli/php_cli_server.c
index e84d9ea97a..1315a62b87 100644
--- a/sapi/cli/php_cli_server.c
+++ b/sapi/cli/php_cli_server.c
@@ -1600,6 +1600,7 @@ static int php_cli_server_client_read_request_on_body(php_http_parser *parser, c
}
client->request.content_len = 0;
}
+ client->request.content = perealloc(client->request.content, client->request.content_len + length, 1);
memmove(client->request.content + client->request.content_len, at, length);
client->request.content_len += length;
return 0;
diff --git a/sapi/fpm/fpm/fastcgi.c b/sapi/fpm/fpm/fastcgi.c
index 99905c8b60..ec579eadf6 100644
--- a/sapi/fpm/fpm/fastcgi.c
+++ b/sapi/fpm/fpm/fastcgi.c
@@ -426,8 +426,9 @@ static int fcgi_get_params(fcgi_request *req, unsigned char *p, unsigned char *e
char buf[128];
char *tmp = buf;
size_t buf_size = sizeof(buf);
- int name_len, val_len;
- uint eff_name_len;
+ int name_len = 0;
+ int val_len = 0;
+ uint eff_name_len = 0;
char *s;
int ret = 1;
size_t bytes_consumed;
diff --git a/sapi/fpm/fpm/fpm_children.c b/sapi/fpm/fpm/fpm_children.c
index 84a9474332..45cc075b42 100644
--- a/sapi/fpm/fpm/fpm_children.c
+++ b/sapi/fpm/fpm/fpm_children.c
@@ -251,7 +251,7 @@ void fpm_children_bury() /* {{{ */
}
zlog(severity, "[pool %s] child %d exited %s after %ld.%06d seconds from start", child->wp->config->name, (int) pid, buf, tv2.tv_sec, (int) tv2.tv_usec);
} else {
- zlog(ZLOG_DEBUG, "[pool %s] child %d has been killed by the process managment after %ld.%06d seconds from start", child->wp->config->name, (int) pid, tv2.tv_sec, (int) tv2.tv_usec);
+ zlog(ZLOG_DEBUG, "[pool %s] child %d has been killed by the process management after %ld.%06d seconds from start", child->wp->config->name, (int) pid, tv2.tv_sec, (int) tv2.tv_usec);
}
fpm_child_close(child, 1 /* in event_loop */);
diff --git a/sapi/fpm/fpm/fpm_sockets.c b/sapi/fpm/fpm/fpm_sockets.c
index 145b2550c3..e056565ea4 100644
--- a/sapi/fpm/fpm/fpm_sockets.c
+++ b/sapi/fpm/fpm/fpm_sockets.c
@@ -487,6 +487,7 @@ int fpm_socket_unix_test_connect(struct sockaddr_un *sock, size_t socklen) /* {{
}
if (connect(fd, (struct sockaddr *)sock, socklen) == -1) {
+ close(fd);
return -1;
}
diff --git a/sapi/fpm/fpm/fpm_sockets.h b/sapi/fpm/fpm/fpm_sockets.h
index cce5712b8c..121c016a7b 100644
--- a/sapi/fpm/fpm/fpm_sockets.h
+++ b/sapi/fpm/fpm/fpm_sockets.h
@@ -19,7 +19,7 @@
#if (__FreeBSD__) || (__OpenBSD__)
#define FPM_BACKLOG_DEFAULT -1
#else
-#define FPM_BACKLOG_DEFAULT 128
+#define FPM_BACKLOG_DEFAULT 65535
#endif
enum fpm_address_domain fpm_sockets_domain_from_address(char *addr);
diff --git a/sapi/fpm/php-fpm.8.in b/sapi/fpm/php-fpm.8.in
index a4e7e74e20..b02aa25ba7 100644
--- a/sapi/fpm/php-fpm.8.in
+++ b/sapi/fpm/php-fpm.8.in
@@ -96,7 +96,7 @@ Specify alternative path to FastCGI process manager configuration file (the defa
.PD 1
.B \-t
Test FPM configuration file and exit
-If called twice (-tt), the configuration is dumped before exiting.
+If called twice (\-tt), the configuration is dumped before exiting.
.TP
.PD 0
.B \-\-daemonize
diff --git a/sapi/fpm/php-fpm.conf.in b/sapi/fpm/php-fpm.conf.in
index af4f2fa325..9002a2933b 100644
--- a/sapi/fpm/php-fpm.conf.in
+++ b/sapi/fpm/php-fpm.conf.in
@@ -159,8 +159,8 @@ group = @php_fpm_group@
listen = 127.0.0.1:9000
; Set listen(2) backlog.
-; Default Value: 128 (-1 on FreeBSD and OpenBSD)
-;listen.backlog = 128
+; Default Value: 65535 (-1 on FreeBSD and OpenBSD)
+;listen.backlog = 65535
; Set permissions for unix socket, if one is used. In Linux, read/write
; permissions must be set in order to allow connections from a web server. Many