Browse Source

Only fetch globals if it's necessary (which it usually won't be)

PHP-4.0.5
Zeev Suraski 27 years ago
parent
commit
1895a09749
  1. 7
      sapi/cgi/cgi_main.c

7
sapi/cgi/cgi_main.c

@ -87,10 +87,11 @@ extern int ap_php_optind;
static int sapi_cgibin_ub_write(const char *str, uint str_length)
{
int ret;
PLS_FETCH();
ret = fwrite(str, 1, str_length, stdout);
if (ret != str_length) {
PLS_FETCH();
PG(connection_status) = PHP_CONNECTION_ABORTED;
if (!PG(ignore_user_abort)) {
zend_bailout();
@ -103,9 +104,9 @@ static int sapi_cgibin_ub_write(const char *str, uint str_length)
static void sapi_cgibin_flush(void *server_context)
{
PLS_FETCH();
if (fflush(stdout)==EOF) {
PLS_FETCH();
if (fflush(stdout)) {
PG(connection_status) = PHP_CONNECTION_ABORTED;
if (!PG(ignore_user_abort)) {
zend_bailout();

Loading…
Cancel
Save