The doc for ap_get_brigade goes:

/**
 * Get the current bucket brigade from the next filter on the filter
 * stack.  The filter returns an apr_status_t value.  If the bottom-most
 * filter doesn't read from the network, then ::AP_NOBODY_READ is returned.
 * The bucket brigade will be empty when there is nothing left to get.

However I see a situation where, the client went away long time ago and the connection handler continues getting APR::EOF and the returned brigade is not empty (some empty IMMORTAL bucket) when calling ap_get_brigade and a custom output filter is installed.

What's the right condition to abort the loop? e.g in the pseudo code:

    while (1) {
        my $rc = $c->input_filters->get_brigade($bb, Apache::MODE_GETLINE);

        last if $bb->is_empty;
        # process $bb...
        last if $rc == APR::EOF;
   }

should I just check for EOF and not check whether the brigade is empty? If so, can EOF come and the brigade not being empty? It looks like I need to check both.

--
__________________________________________________________________
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

Reply via email to