Re: [PHP4BETA] cvs: php4 /sapi/cgi/ cgi_main.c

[email protected]
Newsgroups php.version4
Message-ID <[email protected]>
On Thu, May 25, 2000 at 02:43:30PM -0000, Zeev Suraski wrote:
> zeev		Thu May 25 16:43:30 2000 EDT
> 
>   Modified files:
>     /php4/sapi/cgi	cgi_main.c 
>   Log:
>   Only fetch globals if it's necessary (which it usually won't be)

    zeev, good intention - but this is cgi-mode. very unlikely
    that those macros will ever expand to actual code (unless
    debugging ZTS mode).

    anyhow - you're right...

>   
>   
> Index: php4/sapi/cgi/cgi_main.c
> diff -u php4/sapi/cgi/cgi_main.c:1.45 php4/sapi/cgi/cgi_main.c:1.46
> --- php4/sapi/cgi/cgi_main.c:1.45	Thu May 25 09:01:34 2000
> +++ php4/sapi/cgi/cgi_main.c	Thu May 25 16:43:30 2000
> @@ -87,10 +87,11 @@
>  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 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();
> 
> 
> 
> -- 
> PHP 4.0 Beta Mailing List <http://www.php.net/version4/>
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
> To contact the list administrators, e-mail: [email protected]

-- 

Thies C. Arntzen                 "One Big-Mac, Small Fries and a Coke!"
Digital Collections             Phone +49 40 235350 Fax +49 40 23535180
Hammerbrookstr. 93                              20097 Hamburg / Germany
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.