[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [Libevent-users] Deep recursive call of bufferevent write callback when openssl is in use



On Mon, Feb 18, 2013 at 8:58 PM, JiaQiang Xu <xjqkilling@xxxxxxxxx> wrote:
> 2013/2/19 Nick Mathewson <nickm@xxxxxxxxxxxxx>:
>> On Mon, Feb 18, 2013 at 9:01 AM, JiaQiang Xu <xjqkilling@xxxxxxxxx> wrote:
>>> Hi,
>>>
>>> I'm using libevent to write an http server for transferring files. I
>>> use openssl for https.
>>
>> Have you tried looking at the BEV_OPT_DEFER_CALLBACKS option?  Its
>> main role it to prevent infinite chains of recursive callbacks like
>> this.
>>
>
> I'm going to try this. Would setting this option affect the
> functionality of libevent openssl?

It shouldn't hurt anything.

> And if this is need to make it work, why not set it in libevent
> openssl by default?

It is only needed to make it work in some cases, and when it's not
needed, it adds an extra layer of indirection.  At the time, I was
worried about performance there. I doubt that layer would matter on
openssl benchmarks, but I don't know that anybody's checked to make
sure.

I'm hoping that in 2.1 I (or someone else!) can use the new generic
callback infrastructure so that the DEFER_CALLBACKS flags become
generally unneeded, and can be replaced by an "avoid reentrant
callback invocation" mechanism.

-- 
Nick
***********************************************************************
To unsubscribe, send an e-mail to majordomo@xxxxxxxxxxxxx with
unsubscribe libevent-users    in the body.