On 06/19/2015 09:51 AM, Eric Covener wrote:
I have a proprietary module that uses a proprietary library. The
library needs an EOR cleanup that must run on the same thread as the
handler.  During async write completion it will often happen on the
wrong thread.

Can ap_hook_{suspend_resume}_connection() allow you to remove that requirement?


There's already a path for forcing a blocking write of a particular
bucket, so it is a one-liner to add a new condition.  But I am having
trouble deciding how to best flip this on -- add a new request_rec
field? Use a request note? Some kind of other way for a module to
influence the core output filter directly?

This is the neighborhood in core_filters.c:

511         if (APR_BUCKET_IS_FLUSH(bucket)
512             || non_file_bytes_in_brigade >= THRESHOLD_MAX_BUFFER
513             || morphing_bucket_in_brigade
514             || eor_buckets_in_brigade > MAX_REQUESTS_IN_PIPELINE) {
515             /* this segment of the brigade MUST be sent before returning. */
516
517             if (loglevel >= APLOG_TRACE6) {
518                 char *reason = APR_BUCKET_IS_FLUSH(bucket) ?
519                                "FLUSH bucket" :
520                                (non_file_bytes_in_brigade >=
THRESHOLD_MAX_BUFFER) ?

Thanks for any ideas.   I would default to adding a request_rec field,
but we have been bitten by just extending request_rec and that is not
really addressed yet so I am hesitant.  I don't know how expensive a
note lookup is, but it seems bad to do anything un-necesary per-bucet.

Reply via email to