mirror of
https://github.com/php/php-src.git
synced 2025-08-20 01:14:28 +02:00
Might as well bail as soon as we know we should since this is now
possible. We still need to set our connection status bit field so a shutdown function can figure out if a script was terminated due to an abort, timeout or finished normally.
This commit is contained in:
parent
0bede914ab
commit
82d975d671
2 changed files with 4 additions and 3 deletions
|
|
@ -244,7 +244,7 @@ void php3_apache_puts(const char *s)
|
||||||
|
|
||||||
if (SG(server_context)) {
|
if (SG(server_context)) {
|
||||||
if(rputs(s, (request_rec *) SG(server_context))==-1) {
|
if(rputs(s, (request_rec *) SG(server_context))==-1) {
|
||||||
PG(connection_status) = PHP_CONNECTION_ABORTED;
|
PG(connection_status) |= PHP_CONNECTION_ABORTED;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
fputs(s, stdout);
|
fputs(s, stdout);
|
||||||
|
|
@ -257,7 +257,7 @@ void php3_apache_putc(char c)
|
||||||
|
|
||||||
if (SG(server_context)) {
|
if (SG(server_context)) {
|
||||||
if(rputc(c, (request_rec *) SG(server_context))!=c) {
|
if(rputc(c, (request_rec *) SG(server_context))!=c) {
|
||||||
PG(connection_status) = PHP_CONNECTION_ABORTED;
|
PG(connection_status) |= PHP_CONNECTION_ABORTED;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
fputc(c, stdout);
|
fputc(c, stdout);
|
||||||
|
|
@ -853,7 +853,7 @@ int php_module_startup(sapi_module_struct *sf)
|
||||||
|
|
||||||
PG(header_is_being_sent) = 0;
|
PG(header_is_being_sent) = 0;
|
||||||
SG(request_info).headers_only = 0;
|
SG(request_info).headers_only = 0;
|
||||||
PG(connection_status) = PHP_CONNECTION_NORMAL;
|
PG(connection_status) |= PHP_CONNECTION_NORMAL;
|
||||||
|
|
||||||
#if HAVE_SETLOCALE
|
#if HAVE_SETLOCALE
|
||||||
setlocale(LC_CTYPE, "");
|
setlocale(LC_CTYPE, "");
|
||||||
|
|
|
||||||
|
|
@ -103,6 +103,7 @@ static int zend_apache_ub_write(const char *str, uint str_length)
|
||||||
}
|
}
|
||||||
if(ret != str_length) {
|
if(ret != str_length) {
|
||||||
PG(connection_status) = PHP_CONNECTION_ABORTED;
|
PG(connection_status) = PHP_CONNECTION_ABORTED;
|
||||||
|
if(!PG(ignore_user_abort)) zend_bailout();
|
||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue