summaryrefslogtreecommitdiff
path: root/main/fastcgi.c
diff options
context:
space:
mode:
authorNikita Popov <nikic@php.net>2017-01-07 22:42:45 +0100
committerNikita Popov <nikic@php.net>2017-01-07 22:45:19 +0100
commitf346bd6ee6a9eecb3666071d3afd30216439367d (patch)
treec4e5891c6a8e352e6e2a7ca38ad015cb4f42d7dc /main/fastcgi.c
parent2cb8950cc2ce784a9660a3e07ddf84a9094cfe91 (diff)
downloadphp-git-f346bd6ee6a9eecb3666071d3afd30216439367d.tar.gz
Rename fcgi_request.closed to .ended
"closed" refers to whether FCGI_END_REQUEST has been sent, while the "close" operation does something entirely different. It gets extra confusing when fcgi_is_closed() does not actually return fcgi_request.closed...
Diffstat (limited to 'main/fastcgi.c')
-rw-r--r--main/fastcgi.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/main/fastcgi.c b/main/fastcgi.c
index bf4eb6ca26..c52d222df5 100644
--- a/main/fastcgi.c
+++ b/main/fastcgi.c
@@ -216,7 +216,7 @@ struct _fcgi_request {
#ifdef TCP_NODELAY
int nodelay;
#endif
- int closed;
+ int ended;
int in_len;
int in_pad;
@@ -1045,7 +1045,7 @@ static int fcgi_read_request(fcgi_request *req)
unsigned char buf[FCGI_MAX_LENGTH+8];
req->keep = 0;
- req->closed = 0;
+ req->ended = 0;
req->in_len = 0;
req->out_hdr = NULL;
req->out_pos = req->out_buf;
@@ -1503,7 +1503,7 @@ static inline void close_packet(fcgi_request *req)
}
}
-int fcgi_flush(fcgi_request *req, int close)
+int fcgi_flush(fcgi_request *req, int end)
{
int len;
@@ -1511,7 +1511,7 @@ int fcgi_flush(fcgi_request *req, int close)
len = (int)(req->out_pos - req->out_buf);
- if (close) {
+ if (end) {
fcgi_end_request_rec *rec = (fcgi_end_request_rec*)(req->out_pos);
fcgi_make_header(&rec->hdr, FCGI_END_REQUEST, req->id, sizeof(fcgi_end_request));
@@ -1650,9 +1650,9 @@ int fcgi_finish_request(fcgi_request *req, int force_close)
int ret = 1;
if (req->fd >= 0) {
- if (!req->closed) {
+ if (!req->ended) {
ret = fcgi_flush(req, 1);
- req->closed = 1;
+ req->ended = 1;
}
fcgi_close(req, force_close, 1);
}