[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[Libevent-users] Bufferevent filter with greedy sender
- To: libevent-users@xxxxxxxx
- Subject: [Libevent-users] Bufferevent filter with greedy sender
- From: kgardenia42 <kgardenia42@xxxxxxxxxxxxxx>
- Date: Sat, 27 Apr 2013 18:52:24 +0100
- Delivered-to: archiver@xxxxxxxx
- Delivered-to: libevent-users-outgoing@xxxxxxxx
- Delivered-to: libevent-users@xxxxxxxx
- Delivery-date: Sat, 27 Apr 2013 13:52:28 -0400
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20120113; h=mime-version:x-received:date:message-id:subject:from:to :content-type; bh=HzzPf5e8PxSe9TkikqaOf5GgokJJtFpbBPU+20xKewo=; b=MHbXVZ6ieaBVOX9mzM1L2X3hGrHyp0sNyiueESDDqVfz06R0OFhckBmYkpitTkHLrg 23JUT6GET0Yi4kmNmN7I9YESw5abVtRAS2axi7W7XtoU0Si5AkY414QvB7iaCiHl3Nin fBKi0vTheDwig1qfGEKJPB/eC2IkcTrOm/50zIfOgrWkW6Nm42KPqOiLUBgUw0zk5Jr9 QneKMLBJXeMMUySYr0jV4FNJqsEBXAtavsdh3Hs+RCPDbQW+lGXPXo92Q8e3XiRE/pt3 QwIuLYvrGHtG8HkSYiyT0CxtMUSQQ6HZCdD3TqszNYb6WREVApIoZcNooUQIuT9sCI1v pOyA==
- Reply-to: libevent-users@xxxxxxxxxxxxx
- Sender: owner-libevent-users@xxxxxxxxxxxxx
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.