]> granicus.if.org Git - libevent/commit
Refactor our 'suspend operation' logic on bufferevents.
authorNick Mathewson <nickm@torproject.org>
Mon, 23 Nov 2009 23:34:32 +0000 (18:34 -0500)
committerNick Mathewson <nickm@torproject.org>
Fri, 4 Dec 2009 19:15:17 +0000 (14:15 -0500)
commit0d744aa1738f6f16324a07f6185107d28c4f7fe4
treeb6a5371e7bd11501efb73c69c669e7ebf8e9428b
parent438f9ed26c63bd47c9e1a5cbe52731996f05c3ea
Refactor our 'suspend operation' logic on bufferevents.

There are lots of things we do internally in bufferevents to indicate
"the user would like this operation to happen, but we aren't going to
try until some other condition goes away."  Our logic here has gotten
entirely too complicated.

This patch tries to fix that by adding the idea of 'suspend flags' for
read and write.  To say "don't bother reading or writing until
condition X no longer holds," bufferevent_suspend_read/write(bev,
BEV_SUSPEND_X).  When X no longer holds, call
bufferevent_unsuspend_read/write(bev, BEV_SUSPEND_X).

Right now, only the read-watermark logic uses this.
bufferevent-internal.h
bufferevent.c