On 10 Dec 2014, at 12:22 AM, Yann Ylavic <[email protected]> wrote:

>>> +            rv = ap_get_brigade(f->next, ctx->tmp, mode, block,
>>> ctx->remaining);
>>> +
> 
> But if you want to keep the following apr_bucket_read() nonblocking,
> you could do :
> 
> if (APR_BRIGADE_EMPTY(ctx->tmp) {
>    rv = ap_get_brigade(f->next, ctx->tmp, mode, block, ctx->remaining);
> }
> 
> and then below :
> 
> rv = apr_bucket_read(e, &data, &size, block);
> if (APR_STATUS_IS_EAGAIN(rv)) {
>    if (APR_BRIGADE_EMPTY(ctx->bb) {
>        return rv;
>    }
>    break:
> }
> if (APR_SUCCESS != rv) {
>    return rv;
> }
> do_crypto(f, (unsigned char *) data, size, 0);
> ...

It has always seemed wrong to me to assume what is in the brigade from an 
earlier filter (ie that the bucket will be memory resident and therefore non 
blocking).

Incorporating the above, How about this?

Regards,
Graham
—

Attachment: httpd-mod_crypto-3.patch
Description: Binary data

Reply via email to