httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ben Laurie <>
Subject Re: socket_read?
Date Sun, 18 Feb 2001 01:59:36 GMT
Cliff Woolley wrote:
> ---Greg Stein wrote:
> > Right. But I'm with Ben: an EOF is an EOF. The bucket shouldn't mask over
> > that based on how it happened to be read.
> >
> > If the filter / brigade / whatever, wants to interpret EOF in different ways
> > (e.g. make it an EOS), then that is fine. But the bucket shouldn't be used
> > as a compensating mechanism for that.
> Just a note of caution:  changing a few bucket types (ie, pipe and socket) to
> return APR_EOF in this case will break lots of otherwise simple constructs like
> this:
>     if ((rv=apr_bucket_read(e,&s,&len,APR_BLOCK_READ)) != APR_SUCCESS)
>         return rv;
> So if we're going to change this behavior, we have to be sure to look through
> every use of apr_bucket_read to make sure that the behavior of the caller
> remains we want (it certainly wouldn't in this case).

Break in what sense? It will cause them to return EOF when they read an
EOF. Is that broken? If you carry on reading past an EOF what is the
expected behaviour from the underlying filter? Surely once its returned
EOF its game over?

Of course, the right answer may be that socket_read shouldn't return EOF
at all, it should return an EOS bucket. But that's a different matter -
what I'm currently trying to establish is that it should do the same
thing regardless of whether it is blocking or not.

I actually suspect it is doing the wrong thing in both cases currently
(i.e. empty bucket in one, APR_EOF in the other, instead of EOS bucket
in both), so once we've all agreed the first point, let's figure this
one out, too!

BTW, I'm about to check in a working mod_tls. Yay!

Changing this will mean I'll probably have to change it. But I can live
with that. :-)




"There is no limit to what a man can do or how far he can go if he
doesn't mind who gets the credit." - Robert Woodruff

View raw message