httpd-apreq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joe Schaefer <joe+apa...@sunstarsys.com>
Subject Re: a missing while block runs the next statement?
Date Fri, 19 Apr 2002 13:35:35 GMT
Stas Bekman <stas@stason.org> writes:

> I think this patch is needed. Otherwise to me it looks like we have:
> 
>    ap_hard_timeout(...)
>    while (...) {
>        ap_kill_timeout(...);
>    }
> 
> or was this intentional and therefore the indent is wrong?

In C, the {} braces are for grouping multiple statements into a single
compound statement.

> 
> while porting, I'm enforcing explicit {} everywhere per apache style.
                                                          ^^^^^^^^^^^^

The apache style guide does NOT _enforce_ {} everywhere.

[...]

>               ap_hard_timeout("[libapreq] parse_multipart", r);
> -            while ( ap_get_client_block(r, buff, sizeof(buff)) > 0 )
> +            while ( ap_get_client_block(r, buff, sizeof(buff)) > 0 ) {
>                   /* wait for more input to ignore */ ;
> +            }

As far as the C compiler is concerned, your patch changes 
absolutely nothing.  However, I don't object to your patch
if you think it makes the code clearer.

-- 
Joe Schaefer


Mime
View raw message