[or-cvs] when event_add or event_del fail, tell us why.

arma at seul.org arma at seul.org
Mon Mar 13 19:33:49 UTC 2006


Update of /home2/or/cvsroot/tor/src/or
In directory moria:/home/arma/work/onion/cvs/tor/src/or

Modified Files:
	main.c 
Log Message:
when event_add or event_del fail, tell us why.


Index: main.c
===================================================================
RCS file: /home2/or/cvsroot/tor/src/or/main.c,v
retrieving revision 1.632
retrieving revision 1.633
diff -u -p -d -r1.632 -r1.633
--- main.c	12 Mar 2006 23:31:16 -0000	1.632
+++ main.c	13 Mar 2006 19:33:46 -0000	1.633
@@ -319,8 +319,9 @@ connection_stop_reading(connection_t *co
   log_debug(LD_NET,"connection_stop_reading() called.");
   if (event_del(conn->read_event))
     log_warn(LD_NET, "Error from libevent setting read event state for %d "
-             "to unwatched.",
-             conn->s);
+             "to unwatched: %s",
+             conn->s,
+             tor_socket_strerror(tor_socket_errno(conn->s)));
 }
 
 /** Tell the main loop to start notifying <b>conn</b> of any read events. */
@@ -332,8 +333,9 @@ connection_start_reading(connection_t *c
 
   if (event_add(conn->read_event, NULL))
     log_warn(LD_NET, "Error from libevent setting read event state for %d "
-             "to watched.",
-             conn->s);
+             "to watched: %s",
+             conn->s,
+             tor_socket_strerror(tor_socket_errno(conn->s)));
 }
 
 /** Return true iff <b>conn</b> is listening for write events. */
@@ -354,9 +356,9 @@ connection_stop_writing(connection_t *co
 
   if (event_del(conn->write_event))
     log_warn(LD_NET, "Error from libevent setting write event state for %d "
-             "to unwatched.",
-             conn->s);
-
+             "to unwatched: %s",
+             conn->s,
+             tor_socket_strerror(tor_socket_errno(conn->s)));
 }
 
 /** Tell the main loop to start notifying <b>conn</b> of any write events. */
@@ -368,8 +370,9 @@ connection_start_writing(connection_t *c
 
   if (event_add(conn->write_event, NULL))
     log_warn(LD_NET, "Error from libevent setting write event state for %d "
-             "to watched.",
-             conn->s);
+             "to watched: %s",
+             conn->s,
+             tor_socket_strerror(tor_socket_errno(conn->s)));
 }
 
 /** Close all connections that have been scheduled to get closed */



More information about the tor-commits mailing list