Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions main/fastcgi.c
Original file line number Diff line number Diff line change
Expand Up @@ -462,6 +462,11 @@ void fcgi_terminate(void)
in_shutdown = 1;
}

void fcgi_request_set_keep(fcgi_request *req, int new_value)
{
req->keep = new_value;
}

#ifndef HAVE_ATTRIBUTE_WEAK
void fcgi_set_logger(fcgi_logger lg) {
fcgi_log = lg;
Expand Down Expand Up @@ -1472,6 +1477,7 @@ int fcgi_accept_request(fcgi_request *req)
return -1;
}
if (fcgi_read_request(req)) {
req->hook.on_read();
#ifdef _WIN32
if (is_impersonate && !req->tcp) {
pipe = (HANDLE)_get_osfhandle(req->fd);
Expand Down
1 change: 1 addition & 0 deletions main/fastcgi.h
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ int fcgi_accept_request(fcgi_request *req);
int fcgi_finish_request(fcgi_request *req, int force_close);
const char *fcgi_get_last_client_ip();
void fcgi_set_in_shutdown(int new_value);
void fcgi_request_set_keep(fcgi_request *req, int new_value);

#ifndef HAVE_ATTRIBUTE_WEAK
typedef void (*fcgi_logger)(int type, const char *fmt, ...) ZEND_ATTRIBUTE_FORMAT(printf, 2, 3);
Expand Down
3 changes: 2 additions & 1 deletion sapi/fpm/fpm/fpm_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1995,7 +1995,8 @@ consult the installation file that came with this distribution, or visit \n\

requests++;
if (UNEXPECTED(max_requests && (requests == max_requests))) {
fcgi_finish_request(request, 1);
fcgi_request_set_keep(request, 0);
fcgi_finish_request(request, 0);
break;
}
/* end of fastcgi loop */
Expand Down