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

[or-cvs] Use recent libevent features when possible



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

Modified Files:
	config.c main.c 
Log Message:
Use recent libevent features when possible

Index: config.c
===================================================================
RCS file: /home/or/cvsroot/tor/src/or/config.c,v
retrieving revision 1.327
retrieving revision 1.328
diff -u -d -r1.327 -r1.328
--- config.c	27 Mar 2005 06:25:33 -0000	1.327
+++ config.c	1 Apr 2005 02:37:40 -0000	1.328
@@ -269,7 +269,16 @@
     start_daemon(options->DataDirectory);
   }
   if (!libevent_initialized) {
+    configure_libevent_logging();
     event_init();
+#if defined(HAVE_EVENT_GET_VERSION) && defined(HAVE_EVENT_GET_METHOD)
+    /* Making this a NOTICE for now so we can link bugs to a libevent versions
+     * or methods better. */
+    log_fn(LOG_NOTICE, "Initialized libevent version %s using method %s",
+           event_get_version(), event_get_method());
+#else
+    log_fn(LOG_NOTICE, "Initialized old libevent (version 1.0b or earlier)");
+#endif
     libevent_initialized = 1;
   }
 

Index: main.c
===================================================================
RCS file: /home/or/cvsroot/tor/src/or/main.c,v
retrieving revision 1.479
retrieving revision 1.480
diff -u -d -r1.479 -r1.480
--- main.c	31 Mar 2005 19:26:33 -0000	1.479
+++ main.c	1 Apr 2005 02:37:40 -0000	1.480
@@ -953,8 +953,13 @@
       int e = errno;
       /* let the program survive things like ^z */
       if (e != EINTR) {
-        log_fn(LOG_ERR,"event poll failed: %s [%d]",
+#ifdef HAVE_EVENT_GET_METHOD
+        log_fn(LOG_ERR,"libevent poll with %s failed: %s [%d]",
+               event_get_method(), tor_socket_strerror(e), e);
+#else
+        log_fn(LOG_ERR,"libevent poll failed: %s [%d]",
                tor_socket_strerror(e), e);
+#endif
         return -1;
       } else {
         log_fn(LOG_DEBUG,"event poll interrupted.");