Thank you Azat.

So I ran my test code with Libevent version (2.2.0-alpha-dev):
it seems that there is no difference because the call to bufferevent_flush 
triggers filter cb but still not read cb.

Concerning evbuffer, you mean using evbuffer_remove with a data_ptr refencing 
the mmaped file ?
That's what i'm doing from inside the read cb

----- Mail original -----
De: "Azat Khuzhin" <[email protected]>
À: [email protected]
Envoyé: Lundi 19 Mars 2018 19:25:08
Objet: Re: [Libevent-users] filter bufferevents and timeout

On Mon, Mar 19, 2018 at 12:26 PM, Bruno CARLUS <[email protected]> wrote:
> Hello,
> Ok thank you!
> For the moment I just bypassed the flush: because i know when my stream is 
> over i trigger a BEV_EVENT_EOF from the filter callback, and then handle the 
> remaining data in input buffer within the event callback.

So could you try next patch please?
  
https://github.com/azat/libevent/commit/ed38bfb4ea46e3a53c0dba0c7cabd0dfbd30f047.patch

Or, if you need the whole tree:
  https://github.com/azat/libevent.git be-filter-watermarks

(It is just a WIP, I will rebase it later).

> I was thinking of a file as a bufferevent output-only:
> we read data from a socket into input buffer, filter it then add it to the 
> output buffer which writes into the file.

Why not just using evbuffer for this?

  Azat.
***********************************************************************
To unsubscribe, send an e-mail to [email protected] with
unsubscribe libevent-users    in the body.
***********************************************************************
To unsubscribe, send an e-mail to [email protected] with
unsubscribe libevent-users    in the body.

Reply via email to