mirror of
https://github.com/php/php-src.git
synced 2024-11-24 18:34:21 +08:00
Merge branch 'PHP-7.0' into PHP-7.1
This commit is contained in:
commit
bb2ab75555
@ -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;
|
||||
@ -1506,7 +1506,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;
|
||||
|
||||
@ -1514,7 +1514,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));
|
||||
@ -1648,15 +1648,21 @@ int fcgi_write(fcgi_request *req, fcgi_request_type type, const char *str, int l
|
||||
return len;
|
||||
}
|
||||
|
||||
int fcgi_end(fcgi_request *req) {
|
||||
int ret = 1;
|
||||
if (!req->ended) {
|
||||
ret = fcgi_flush(req, 1);
|
||||
req->ended = 1;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
int fcgi_finish_request(fcgi_request *req, int force_close)
|
||||
{
|
||||
int ret = 1;
|
||||
|
||||
if (req->fd >= 0) {
|
||||
if (!req->closed) {
|
||||
ret = fcgi_flush(req, 1);
|
||||
req->closed = 1;
|
||||
}
|
||||
ret = fcgi_end(req);
|
||||
fcgi_close(req, force_close, 1);
|
||||
}
|
||||
return ret;
|
||||
|
@ -118,7 +118,8 @@ void fcgi_loadenv(fcgi_request *req, fcgi_apply_func load_func, zval *array);
|
||||
int fcgi_read(fcgi_request *req, char *str, int len);
|
||||
|
||||
int fcgi_write(fcgi_request *req, fcgi_request_type type, const char *str, int len);
|
||||
int fcgi_flush(fcgi_request *req, int close);
|
||||
int fcgi_flush(fcgi_request *req, int end);
|
||||
int fcgi_end(fcgi_request *req);
|
||||
|
||||
#ifdef PHP_WIN32
|
||||
void fcgi_impersonate(void);
|
||||
|
@ -1534,11 +1534,10 @@ PHP_FUNCTION(fastcgi_finish_request) /* {{{ */
|
||||
fcgi_request *request = (fcgi_request*) SG(server_context);
|
||||
|
||||
if (!fcgi_is_closed(request)) {
|
||||
|
||||
php_output_end_all();
|
||||
php_header();
|
||||
|
||||
fcgi_flush(request, 1);
|
||||
fcgi_end(request);
|
||||
fcgi_close(request, 0, 0);
|
||||
RETURN_TRUE;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user