Skip to content

Commit 6d5ea20

Browse files
committed
Merge branch 'PHP-7.0' into PHP-7.1
2 parents bf2627e + 9814be4 commit 6d5ea20

File tree

4 files changed

+13
-5
lines changed

4 files changed

+13
-5
lines changed

NEWS

+4
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@ PHP NEWS
1717
. Fixed bug #73837 ("new DateTime()" sometimes returns 1 second ago value).
1818
(Derick)
1919

20+
- FPM:
21+
. Fixed bug #69860 (php-fpm process accounting is broken with keepalive).
22+
(Denis Yeldandi)
23+
2024
- GD:
2125
. Fixed bug #74031 (ReflectionFunction for imagepng is missing last two
2226
parameters). (finwe)

main/fastcgi.c

+6-4
Original file line numberDiff line numberDiff line change
@@ -462,6 +462,11 @@ void fcgi_terminate(void)
462462
in_shutdown = 1;
463463
}
464464

465+
void fcgi_request_set_keep(fcgi_request *req, int new_value)
466+
{
467+
req->keep = new_value;
468+
}
469+
465470
#ifndef HAVE_ATTRIBUTE_WEAK
466471
void fcgi_set_logger(fcgi_logger lg) {
467472
fcgi_log = lg;
@@ -1429,8 +1434,6 @@ int fcgi_accept_request(fcgi_request *req)
14291434
struct pollfd fds;
14301435
int ret;
14311436

1432-
req->hook.on_read();
1433-
14341437
fds.fd = req->fd;
14351438
fds.events = POLLIN;
14361439
fds.revents = 0;
@@ -1443,8 +1446,6 @@ int fcgi_accept_request(fcgi_request *req)
14431446
}
14441447
fcgi_close(req, 1, 0);
14451448
#else
1446-
req->hook.on_read();
1447-
14481449
if (req->fd < FD_SETSIZE) {
14491450
struct timeval tv = {5,0};
14501451
fd_set set;
@@ -1471,6 +1472,7 @@ int fcgi_accept_request(fcgi_request *req)
14711472
} else if (in_shutdown) {
14721473
return -1;
14731474
}
1475+
req->hook.on_read();
14741476
if (fcgi_read_request(req)) {
14751477
#ifdef _WIN32
14761478
if (is_impersonate && !req->tcp) {

main/fastcgi.h

+1
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ int fcgi_accept_request(fcgi_request *req);
102102
int fcgi_finish_request(fcgi_request *req, int force_close);
103103
const char *fcgi_get_last_client_ip();
104104
void fcgi_set_in_shutdown(int new_value);
105+
void fcgi_request_set_keep(fcgi_request *req, int new_value);
105106

106107
#ifndef HAVE_ATTRIBUTE_WEAK
107108
typedef void (*fcgi_logger)(int type, const char *fmt, ...) ZEND_ATTRIBUTE_FORMAT(printf, 2, 3);

sapi/fpm/fpm/fpm_main.c

+2-1
Original file line numberDiff line numberDiff line change
@@ -1995,7 +1995,8 @@ consult the installation file that came with this distribution, or visit \n\
19951995

19961996
requests++;
19971997
if (UNEXPECTED(max_requests && (requests == max_requests))) {
1998-
fcgi_finish_request(request, 1);
1998+
fcgi_request_set_keep(request, 0);
1999+
fcgi_finish_request(request, 0);
19992000
break;
20002001
}
20012002
/* end of fastcgi loop */

0 commit comments

Comments
 (0)