[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[or-cvs] Make Tor use Niels Provos"s libevent instead of it"s current



Update of /home/or/cvsroot/tor/src/common
In directory moria.mit.edu:/tmp/cvs-serv9851/src/common

Modified Files:
	Makefile.am compat.c compat.h 
Removed Files:
	fakepoll.c fakepoll.h 
Log Message:
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.



Index: Makefile.am
===================================================================
RCS file: /home/or/cvsroot/tor/src/common/Makefile.am,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -d -r1.20 -r1.21
--- Makefile.am	1 Nov 2004 20:41:46 -0000	1.20
+++ Makefile.am	12 Jan 2005 06:42:31 -0000	1.21
@@ -3,7 +3,7 @@
 
 #CFLAGS  = -Wall -Wpointer-arith -O2
 
-libor_a_SOURCES = log.c fakepoll.c util.c compat.c container.c
+libor_a_SOURCES = log.c util.c compat.c container.c
 libor_crypto_a_SOURCES = crypto.c aes.c tortls.c torgzip.c
 
-noinst_HEADERS = log.h crypto.h fakepoll.h test.h util.h compat.h aes.h torint.h tortls.h strlcpy.c strlcat.c torgzip.h container.h
+noinst_HEADERS = log.h crypto.h test.h util.h compat.h aes.h torint.h tortls.h strlcpy.c strlcat.c torgzip.h container.h

Index: compat.c
===================================================================
RCS file: /home/or/cvsroot/tor/src/common/compat.c,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -d -r1.26 -r1.27
--- compat.c	3 Jan 2005 19:07:24 -0000	1.26
+++ compat.c	12 Jan 2005 06:42:31 -0000	1.27
@@ -8,7 +8,6 @@
 #define _GNU_SOURCE
 
 #include "orconfig.h"
-#include "fakepoll.h"
 #include "compat.h"
 
 #ifdef MS_WINDOWS

Index: compat.h
===================================================================
RCS file: /home/or/cvsroot/tor/src/common/compat.h,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -d -r1.16 -r1.17
--- compat.h	3 Jan 2005 18:06:50 -0000	1.16
+++ compat.h	12 Jan 2005 06:42:31 -0000	1.17
@@ -115,6 +115,10 @@
 #define tor_close_socket(s) close(s)
 #endif
 
+/* Now that we use libevent, all real sockets are safe for polling ... or
+ * if they aren't, libevent will help us. */
+#define SOCKET_IS_POLLABLE(fd) ((fd)>=0)
+
 struct in_addr;
 int tor_inet_aton(const char *cp, struct in_addr *addr);
 int tor_lookup_hostname(const char *name, uint32_t *addr);

--- fakepoll.c DELETED ---

--- fakepoll.h DELETED ---