On Thu, Apr 02, 2020 at 10:58:21AM +0200, Yann Ylavic wrote: > On Thu, Apr 2, 2020 at 6:39 AM Ruediger Pluem <[email protected]> wrote: > > > > > +#define AP_BUCKET_IS_MORPHING(e) ((e)->length == (apr_size_t)-1) > > > > Nitpick: After having a second thought on the whole thing, I think the > > above name is misleading to some extend. If MMAP is enabled > > a file bucket is also a morphing bucket as a read on it causes the bucket > > to split in an MMAP bucket and a shorter file bucket. > > A MMAP bucket consumes at least address space and I vaguely remember cases > > from the past (back in 32 bit times) where filters that > > processed (doing apr_bucket_read) a whole brigade at once without passing > > results down the chain on a regular basis caused the > > address space to be exhausted by MMAP buckets if the file bucket was huge. > > How about a less subjective: > #define AP_BUCKET_HAS_LENGTH(e) ((e)->length != (apr_size_t)-1) > ? > > If find it quite painful to type e->length == (apr_size_t)-1, though I > could simply use -1 and rely on unsigned promotion..
Formally this is *determinate* length - all buckets have a length just some of them are indeterminate. #define AP_BUCKET_DETERMINATE_LENGTH(e) ((e)->length != (apr_size_t)-1) but it is quite a mouthful and exactly the same number of characters as writing it out longhand. No strong opinion on having a macro for it, probably should be in APR tho ;)
