diff options
author | redfoxli <honghu069@163.com> | 2014-12-09 19:42:55 +0800 |
---|---|---|
committer | redfoxli <honghu069@163.com> | 2014-12-09 19:42:55 +0800 |
commit | d0a58695d00640eafca49c934204e2c1c675fcba (patch) | |
tree | 06e2b7539cae628f7c0aec13efdb495b2893f2b8 | |
parent | f86aa349eb068b6865c6d423054afe7f781f979e (diff) | |
download | php-git-d0a58695d00640eafca49c934204e2c1c675fcba.tar.gz |
fix-bug-68571-to-php5.5
-rw-r--r-- | sapi/fpm/fpm/fastcgi.c | 1 | ||||
-rw-r--r-- | sapi/fpm/fpm/fpm_main.c | 5 |
2 files changed, 5 insertions, 1 deletions
diff --git a/sapi/fpm/fpm/fastcgi.c b/sapi/fpm/fpm/fastcgi.c index d2764a59b7..bcaef1b03e 100644 --- a/sapi/fpm/fpm/fastcgi.c +++ b/sapi/fpm/fpm/fastcgi.c @@ -977,6 +977,7 @@ int fcgi_flush(fcgi_request *req, int close) if (safe_write(req, req->out_buf, len) != len) { req->keep = 0; + req->out_pos = req->out_buf; return 0; } diff --git a/sapi/fpm/fpm/fpm_main.c b/sapi/fpm/fpm/fpm_main.c index 331342c2a2..adc3f5b65a 100644 --- a/sapi/fpm/fpm/fpm_main.c +++ b/sapi/fpm/fpm/fpm_main.c @@ -672,8 +672,11 @@ void sapi_cgi_log_fastcgi(int level, char *message, size_t len) char *buf = malloc(len + 2); memcpy(buf, message, len); memcpy(buf + len, "\n", sizeof("\n")); - fcgi_write(request, FCGI_STDERR, buf, len+1); + ssize_t ret = fcgi_write(request, FCGI_STDERR, buf, len+1); free(buf); + if (ret <= 0) { + php_handle_aborted_connection(); + } } } /* }}} */ |