Stas Bekman <[EMAIL PROTECTED]> writes:
Now going to try and reduce that sequence to a shorter one...
I don't think you need bother- the brigade loop is miscoded in compat.pm's content sub- you can't ask for the next bucket *after* $b has been removed.
why not? it still points to the next bucket, no?
Instead of iterating using for(;;), use while():
while ($b = $bb->first) {
++$seen_eos, last if $b->is_eos;
if ($b->read(my $buf)) {
$data .= $buf;
}
$b->delete; # APR::Bucket needs to wrap apr_bucket_delete(), # since APR_BUCKET_REMOVE() doesn't actually
# decrement the bucket refcount
# so the bucket allocator can reclaim $b
}
I've been explicitly rewriting the iteration loops recently not to use the while loop, because for anything more complicated it becomes a mess and too easy to put $b->delete in the wrong place. I wonder why don't I see the problem right away then, and only after running a bunch of other tests. Any idea why?
-- __________________________________________________________________ Stas Bekman JAm_pH ------> Just Another mod_perl Hacker http://stason.org/ mod_perl Guide ---> http://perl.apache.org mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
