apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "William A. Rowe, Jr." <wr...@rowe-clan.net>
Subject Re: [PATCH] Re: chunking of content in mod_include?
Date Tue, 28 Aug 2001 14:15:43 GMT
From: "Ryan Bloom" <rbb@covalent.net>
Sent: Tuesday, August 28, 2001 8:57 AM


> On Monday 27 August 2001 23:27, Brian Pane wrote:
> 
> > How does this patch look?  It does the check only on bucket
> > boundaries, and it pushes out the buffered content if either:
> >   * the amount of buffered content is too large, or
> >   * the apr_bucket_read would block.
> >
> > +        if (rv == APR_EAGAIN) {
> 
> This needs to be if (APR_STATUS_IS_EAGAIN(rv)) {
> 
> EAGAIN is one of those annoying error conditions, that is completely non-portable,
> so we have to use a macro to check for it.

For those of you coming on to apr or httpd development recently (I count at least
five active patch submitters that haven't been here all that long) ... let me tell
a fast story.

Most non-unixes don't map directly to errno.  We started with a lookup table and
some other bogus stuff to try mapping errors.  It's horribly slow and a poor solution.
Even some Unix errors have this problem with EAGAIN/EWOULDBLOCK.  But PLEASE don't
simply code correctly in this one case, code consistently!

Anyone writing (rv == APR_ESOMETHING) is asking for problems.  That's why we implement
and maintain that APR_STATUS_IS_ESOMETHING() set of macros.  They are fast (no time
difference on Unix at all) and legible in mainline code.

Unless you are looking at an APR-defined status please use APR_STATUS_IS_EFOO to avoid
some difficult to debug bugs from creeping into the code.

Bill




Mime
View raw message