summaryrefslogtreecommitdiff
path: root/bufferevent-internal.h
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2011-03-07 21:55:47 -0500
committerNick Mathewson <nickm@torproject.org>2011-03-07 21:58:16 -0500
commitc8baac90231ab3dc4179b302568c640ab4ae05c8 (patch)
tree8f631f05e603501f0361600353b9379f5d2f362c /bufferevent-internal.h
parent5dc566284d736cb692f88685a3bcec70595a7689 (diff)
downloadlibevent-c8baac90231ab3dc4179b302568c640ab4ae05c8.tar.gz
Followup for Tomash Brechko's http patch
This patch makes bufferevent_disable_hard() non-public, and adds a comment about what it's for and why it's used.
Diffstat (limited to 'bufferevent-internal.h')
-rw-r--r--bufferevent-internal.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/bufferevent-internal.h b/bufferevent-internal.h
index 9d84e739..71711a36 100644
--- a/bufferevent-internal.h
+++ b/bufferevent-internal.h
@@ -36,6 +36,7 @@ extern "C" {
#include "evthread-internal.h"
#include "event2/thread.h"
#include "ratelim-internal.h"
+#include "event2/bufferevent_struct.h"
/* These flags are reasons that we might be declining to actually enable
reading or writing on a bufferevent.
@@ -287,6 +288,20 @@ void bufferevent_unsuspend_write(struct bufferevent *bufev, bufferevent_suspend_
#define bufferevent_wm_unsuspend_read(b) \
bufferevent_unsuspend_read((b), BEV_SUSPEND_WM)
+/*
+ Disable a bufferevent. Equivalent to bufferevent_disable(), but
+ first resets 'connecting' flag to force EV_WRITE down for sure.
+
+ XXXX this method will go away in the future; try not to add new users.
+ See comment in evhttp_connection_reset() for discussion.
+
+ @param bufev the bufferevent to be disabled
+ @param event any combination of EV_READ | EV_WRITE.
+ @return 0 if successful, or -1 if an error occurred
+ @see bufferevent_disable()
+ */
+int bufferevent_disable_hard(struct bufferevent *bufev, short event);
+
/** Internal: Set up locking on a bufferevent. If lock is set, use it.
* Otherwise, use a new lock. */
int bufferevent_enable_locking(struct bufferevent *bufev, void *lock);