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

[Libevent-users] Bufferevent filter with greedy sender



Hi,

I have a bufferevent_filter to parse some protocol data from the "src"
evbuffer and unwrap it into the "dst" evbuffer.

This all works fine.  The problem I have, however, is that when there
is a greedy sender sending a lot of data the input_filter just keeps
getting called hundreds or thousands of times, massively bloating the
dst buffer.

What I would *like* to happen is for the lower level read callback (on
the bev which is wrapped by the filter) to be called so that dst gets
drained and I don't get the bloat.

I've read the docs and I can't seem to grock this part of it and
couldn't find a relevant example.  Can someone please advise how to
accomplish this?

I see that the filter callback has a "enum bufferevent_flush_mode
state" parameter.  Is this relevant here?

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