httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Graham Leggett <minf...@sharp.fm>
Subject Re: [Patch] mod_crypto: A general purpose crypto filter with HLS support
Date Thu, 11 Dec 2014 14:31:44 GMT
On 10 Dec 2014, at 12:22 AM, Yann Ylavic <ylavic.dev@gmail.com> 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
—

Mime
View raw message