httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeff Trawick <trawi...@bellsouth.net>
Subject Re: socket_read?
Date Sat, 17 Feb 2001 18:55:14 GMT
Ben Laurie <ben@algroup.co.uk> writes:

> the end of socket_read (in apr-util/buckets/apr_buckets_socket.c) looks
> like this:
> 
>     if (*len > 0) {
>         b = apr_bucket_socket_create(p);
> 	APR_BUCKET_INSERT_AFTER(a, b);
>     }
>     else if (rv == APR_EOF && block == APR_NONBLOCK_READ) {
>         return APR_EOF;
>     }
>     return APR_SUCCESS;
> }
> 
> why the test for APR_NONBLOCK_READ? Surely an EOF is an EOF, whatever
> mode you are in? Shouldn't it just return APR_EOF if rv == APR_EOF,
> regardless of mode?

It is simplest if the normal blocking read looks to the caller like an
empty bucket; all the caller needs to know is that no error occurred
and there are no bytes in the bucket; caller doesn't care if it is
some sort of in-memory bucket or socket or pipe or whatever.

-- 
Jeff Trawick | trawickj@bellsouth.net | PGP public key at web site:
       http://www.geocities.com/SiliconValley/Park/9289/
             Born in Roswell... married an alien...

Mime
View raw message