httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Brian Havard" <>
Subject ap_read() and APR_EOF (Was: Re: cvs commit: apache-2.0/src/main http_protocol.c)
Date Tue, 02 Nov 1999 03:53:28 GMT
On Mon, 1 Nov 1999 14:33:41 -0500, Manoj Kasichainula wrote:

>On Mon, Nov 01, 1999 at 10:50:49AM -0000, wrote:
>>   In ap_send_fb_length() don't treat APR_EOF as a fatal error.
>Hmmm, I was under the impression that we didn't really use APR_EOF in
>many places. The buff stuff I've done assumed that EOF would be
>indicated with a zero length read and APR_SUCCESS.
>It appears that OS/2's APR code uses APR_EOF in ap_read and ap_write,
>while Unix's does not. 

It only returns APR_EOF in the case where 0 bytes were read which I feel is
the correct behaviour. The status code should tell you WHY you got 0 bytes
back. Returning 'success' when you failed to read any data makes no sense to

>One standard should be chosen.

Absolutely, and it should be documented somewhere.

>I'm not a big fan of APR_EOF in these cases because it makes checking
>for "success" more complicated. 

What's wrong with (status == APR_SUCCESS) ?
The way I've done it you can be sure that 
if status == APR_SUCCESS then nbytes > 0

BTW, I'm only talking about ap_read(). ap_write() never returns APR_EOF, I
don't know where you got that one.....

 |  Brian Havard                 |  "He is not the messiah!                   |
 |  |  He's a very naughty boy!" - Life of Brian |

View raw message