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

[or-cvs] When we get an EOF or a timeout on a directory connection, ...



Update of /home/or/cvsroot/tor/src/or
In directory moria:/tmp/cvs-serv14541/src/or

Modified Files:
	directory.c main.c 
Log Message:
When we get an EOF or a timeout on a directory connection, note how many bytes of serverdesc we are dropping. This will help us determine whether it is smart to parse incomplete serverdesc responses.

Index: directory.c
===================================================================
RCS file: /home/or/cvsroot/tor/src/or/directory.c,v
retrieving revision 1.298
retrieving revision 1.299
diff -u -d -r1.298 -r1.299
--- directory.c	30 Sep 2005 20:04:55 -0000	1.298
+++ directory.c	4 Oct 2005 22:34:09 -0000	1.299
@@ -1111,6 +1111,12 @@
   int retval;
   if (conn->state != DIR_CONN_STATE_CLIENT_READING) {
     log_fn(LOG_INFO,"conn reached eof, not reading. Closing.");
+    /* This check is temporary; it's to let us know whether we should consider
+     * parsing partial serverdesc responses. */
+    if (conn->purpose == DIR_PURPOSE_FETCH_SERVERDESC) {
+      log_fn(LOG_NOTICE, "Reached EOF while downloading server descriptors; dropping %d bytes.",
+             buf_datalen(conn->inbuf));
+    }
     connection_close_immediate(conn); /* it was an error; give up on flushing */
     connection_mark_for_close(conn);
     return -1;

Index: main.c
===================================================================
RCS file: /home/or/cvsroot/tor/src/or/main.c,v
retrieving revision 1.565
retrieving revision 1.566
diff -u -d -r1.565 -r1.566
--- main.c	3 Oct 2005 20:20:38 -0000	1.565
+++ main.c	4 Oct 2005 22:34:09 -0000	1.566
@@ -575,6 +575,12 @@
       conn->timestamp_lastwritten + 5*60 < now) {
     log_fn(LOG_INFO,"Expiring wedged directory conn (fd %d, purpose %d)",
            conn->s, conn->purpose);
+    /* This check is temporary; it's to let us know whether we should consider
+     * parsing partial serverdesc responses. */
+    if (conn->purpose == DIR_PURPOSE_FETCH_SERVERDESC) {
+      log_fn(LOG_NOTICE, "Expired wedged directory conn was downloading server descriptors; dropping %d bytes.",
+             buf_datalen(conn->inbuf));
+    }
     connection_mark_for_close(conn);
     return;
   }