summaryrefslogtreecommitdiff
path: root/src/or/or.h
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2005-01-12 06:42:32 +0000
committerNick Mathewson <nickm@torproject.org>2005-01-12 06:42:32 +0000
commit324b192f68bfe697009831a5bad3acdd7bd2cec5 (patch)
tree13f8d3bd453244fcad1f519667bb4483156113bf /src/or/or.h
parent9b578f2fe2665a1b1a75f6fb5a85f8a77ee31545 (diff)
downloadtor-324b192f68bfe697009831a5bad3acdd7bd2cec5.tar.gz
tor-324b192f68bfe697009831a5bad3acdd7bd2cec5.zip
Make Tor use Niels Provos's libevent instead of it's current
poll-but-sometimes-select mess. This will let us use faster async cores (like epoll, kpoll, and /dev/poll), and hopefully work better on Windows too. There are some fairly nasty changes to main.c here; this will almost certainly break something. But hey, that's what alphas are for. svn:r3341
Diffstat (limited to 'src/or/or.h')
-rw-r--r--src/or/or.h11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/or/or.h b/src/or/or.h
index bde4c2cf41..319e4f2968 100644
--- a/src/or/or.h
+++ b/src/or/or.h
@@ -40,7 +40,6 @@
#include <ctype.h>
#endif
#include "../common/torint.h"
-#include "../common/fakepoll.h"
#ifdef HAVE_INTTYPES_H
#include <inttypes.h>
#endif
@@ -97,6 +96,11 @@
#ifdef HAVE_TIME_H
#include <time.h>
#endif
+#ifdef HAVE_EVENT_H
+#include <event.h>
+#else
+#error "Tor requires libevent to build."
+#endif
#ifdef MS_WINDOWS
#if (_MSC_VER <= 1300)
@@ -494,7 +498,9 @@ struct connection_t {
* the bandwidth throttler allows reads?
*/
int s; /**< Our socket; -1 if this connection is closed. */
- int poll_index; /**< Index of this conn into the poll_array. */
+ int poll_index; /* XXXX rename. */
+ struct event *read_event; /**< libevent event structure. */
+ struct event *write_event; /**< libevent event structure. */
int marked_for_close; /**< Boolean: should we close this conn on the next
* iteration of the main loop?
*/
@@ -1380,6 +1386,7 @@ void consider_hibernation(time_t now);
int connection_add(connection_t *conn);
int connection_remove(connection_t *conn);
int connection_in_array(connection_t *conn);
+void add_connection_to_closeable_list(connection_t *conn);
void get_connection_array(connection_t ***array, int *n);