summaryrefslogtreecommitdiff
path: root/main
diff options
context:
space:
mode:
authorNikita Popov <nikita.ppv@gmail.com>2017-02-12 00:06:47 +0100
committerNikita Popov <nikita.ppv@gmail.com>2017-02-12 00:06:47 +0100
commit5383c9d9e5caf20c7699fa838381757d2818f4f9 (patch)
treef3cf511273e7cb67e69879ddd639a49dabf880fe /main
parent048aec47963ac86580a96ff64fa6d16de2f86045 (diff)
parent6d5ea20e0b0986a5d763ba39c5ad4773c2d6ade6 (diff)
downloadphp-git-5383c9d9e5caf20c7699fa838381757d2818f4f9.tar.gz
Merge branch 'PHP-7.1'
Diffstat (limited to 'main')
-rw-r--r--main/fastcgi.c10
-rw-r--r--main/fastcgi.h1
2 files changed, 7 insertions, 4 deletions
diff --git a/main/fastcgi.c b/main/fastcgi.c
index 0da9c3873e..cca4342f2a 100644
--- a/main/fastcgi.c
+++ b/main/fastcgi.c
@@ -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;
@@ -1429,8 +1434,6 @@ int fcgi_accept_request(fcgi_request *req)
struct pollfd fds;
int ret;
- req->hook.on_read();
-
fds.fd = req->fd;
fds.events = POLLIN;
fds.revents = 0;
@@ -1443,8 +1446,6 @@ int fcgi_accept_request(fcgi_request *req)
}
fcgi_close(req, 1, 0);
#else
- req->hook.on_read();
-
if (req->fd < FD_SETSIZE) {
struct timeval tv = {5,0};
fd_set set;
@@ -1471,6 +1472,7 @@ int fcgi_accept_request(fcgi_request *req)
} else if (in_shutdown) {
return -1;
}
+ req->hook.on_read();
if (fcgi_read_request(req)) {
#ifdef _WIN32
if (is_impersonate && !req->tcp) {
diff --git a/main/fastcgi.h b/main/fastcgi.h
index efadac61d2..4cafc69c6e 100644
--- a/main/fastcgi.h
+++ b/main/fastcgi.h
@@ -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);