httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject Re: Implementing split() on pipe buckets?
Date Sun, 12 Nov 2000 04:30:22 GMT

> One other point about this: all of the rest of the bucket code checks for failed
> mallocs.  Consistency is a Good Thing.  Besides, if there's some weird (but
> recoverable) reason that malloc might fail on some quirky platforms (hypothetical
> situation), then it seems that the Right thing to do would be to return the correct
> apr_status_t value (APR_ENOMEM), rather than returning APR_SUCCESS if the function
> really didn't succeed.  Note that a failure of malloc here might not turn up until
> much later, and debugging it could be a huge hassle.  Of course, in normal
> situations, malloc shouldn't fail unless you're flat out of memory, but why trust it
> (and why bother having the APR_ENOMEM return code in the first place)?

I also agree that consistency is a good thing.  Having the buckets return
ENONMEM is wrong in all places.  APR provides that error code for programs
other than Apache.  Apache in general just doesn't use ENOMEM.


Ryan Bloom               
406 29th St.
San Francisco, CA 94131

View raw message