summaryrefslogtreecommitdiff
path: root/bufferevent-internal.h
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2009-11-04 05:19:26 +0000
committerNick Mathewson <nickm@torproject.org>2009-11-04 05:19:26 +0000
commit86db1c851be804b13aadebcc0b1a21a4493192dd (patch)
treebd6a597a4448dde5a1c2c5f953cfcb7dd0fd0a5e /bufferevent-internal.h
parent6ca32df11ac92a4c3ab417d656253353e28a7dc3 (diff)
downloadlibevent-86db1c851be804b13aadebcc0b1a21a4493192dd.tar.gz
Commit ConnectEx code to get connect working with async bufferevents.
This is code by Chris Davis, with changes to get the unit tests failing less aggressively. The unit tests for this code do not completely pass yet; Chris is looking into that. If they aren't passing by the next release, I'll turn off this code. svn:r1499
Diffstat (limited to 'bufferevent-internal.h')
-rw-r--r--bufferevent-internal.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/bufferevent-internal.h b/bufferevent-internal.h
index eec60e1a..4ee6d908 100644
--- a/bufferevent-internal.h
+++ b/bufferevent-internal.h
@@ -141,6 +141,17 @@ extern const struct bufferevent_ops bufferevent_ops_socket;
extern const struct bufferevent_ops bufferevent_ops_filter;
extern const struct bufferevent_ops bufferevent_ops_pair;
+#define BEV_IS_SOCKET(bevp) ((bevp)->be_ops == &bufferevent_ops_socket)
+#define BEV_IS_FILTER(bevp) ((bevp)->be_ops == &bufferevent_ops_filter)
+#define BEV_IS_PAIR(bevp) ((bevp)->be_ops == &bufferevent_ops_pair)
+
+#ifdef WIN32
+extern const struct bufferevent_ops bufferevent_ops_async;
+#define BEV_IS_ASYNC(bevp) ((bevp)->be_ops == &bufferevent_ops_async)
+#else
+#define BEV_IS_ASYNC(bevp) 0
+#endif
+
/** Initialize the shared parts of a bufferevent. */
int bufferevent_init_common(struct bufferevent_private *, struct event_base *, const struct bufferevent_ops *, enum bufferevent_options options);