Merge branch 'PHP-5.6'

Conflicts:
	sapi/cgi/cgi_main.c
This commit is contained in:
Xinchen Hui 2015-01-27 22:15:12 +08:00
commit 9fdf62d64a
5 changed files with 12 additions and 4 deletions

View File

@ -699,13 +699,16 @@ static void sapi_cgi_log_message(char *message)
request = (fcgi_request*) SG(server_context);
if (request) {
int len = (int)strlen(message);
int ret, len = (int)strlen(message);
char *buf = malloc(len+2);
memcpy(buf, message, len);
memcpy(buf + len, "\n", sizeof("\n"));
fcgi_write(request, FCGI_STDERR, buf, (int)(len+1));
ret = fcgi_write(request, FCGI_STDERR, buf, (int)(len + 1));
free(buf);
if (ret < 0) {
php_handle_aborted_connection();
}
} else {
fprintf(stderr, "%s\n", message);
}

View File

@ -1326,6 +1326,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;
}

View File

@ -965,6 +965,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;
}

View File

@ -614,11 +614,15 @@ void sapi_cgi_log_fastcgi(int level, char *message, size_t len)
* - the message is not empty
*/
if (CGIG(fcgi_logging) && request && message && len > 0) {
int ret;
char *buf = malloc(len + 2);
memcpy(buf, message, len);
memcpy(buf + len, "\n", sizeof("\n"));
fcgi_write(request, FCGI_STDERR, buf, len+1);
ret = fcgi_write(request, FCGI_STDERR, buf, len + 1);
free(buf);
if (ret < 0) {
php_handle_aborted_connection();
}
}
}
/* }}} */

View File

@ -43,7 +43,6 @@ Content-Type: application/octet-stream
phpinfo();
?>
-----------------------------240723202011929--
--FILE--
<?php
error_reporting(0);