Skip to content

Commit 6c87372

Browse files
committed
Merge branch 'fixbug68571tophp5.5' of https://github.com/redfoxli/php-src into PHP-5.5
2 parents 3f57663 + 7953d83 commit 6c87372

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

sapi/fpm/fpm/fastcgi.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -975,6 +975,7 @@ int fcgi_flush(fcgi_request *req, int close)
975975

976976
if (safe_write(req, req->out_buf, len) != len) {
977977
req->keep = 0;
978+
req->out_pos = req->out_buf;
978979
return 0;
979980
}
980981

sapi/fpm/fpm/fpm_main.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -670,10 +670,14 @@ void sapi_cgi_log_fastcgi(int level, char *message, size_t len)
670670
*/
671671
if (CGIG(fcgi_logging) && request && message && len > 0) {
672672
char *buf = malloc(len + 2);
673+
ssize_t ret = 0;
673674
memcpy(buf, message, len);
674675
memcpy(buf + len, "\n", sizeof("\n"));
675-
fcgi_write(request, FCGI_STDERR, buf, len+1);
676+
ret = fcgi_write(request, FCGI_STDERR, buf, len+1);
676677
free(buf);
678+
if (ret <= 0) {
679+
php_handle_aborted_connection();
680+
}
677681
}
678682
}
679683
/* }}} */

0 commit comments

Comments
 (0)