[or-cvs] Give a less frequent and more helpful warning on failed ser...

Nick Mathewson nickm at seul.org
Wed Oct 5 00:22:58 UTC 2005


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

Modified Files:
	directory.c main.c 
Log Message:
Give a less frequent and more helpful warning on failed serverdesc downloads

Index: directory.c
===================================================================
RCS file: /home/or/cvsroot/tor/src/or/directory.c,v
retrieving revision 1.299
retrieving revision 1.300
diff -u -d -r1.299 -r1.300
--- directory.c	4 Oct 2005 22:34:09 -0000	1.299
+++ directory.c	5 Oct 2005 00:22:55 -0000	1.300
@@ -1113,8 +1113,9 @@
     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.",
+    if (conn->purpose == DIR_PURPOSE_FETCH_SERVERDESC &&
+        buf_datalen(conn->inbuf)>=(24*1024)) {
+      log_fn(LOG_NOTICE, "Directory connection closed early after downloading %d bytes of descriptors.  If this happens often, please file a bug report.",
              buf_datalen(conn->inbuf));
     }
     connection_close_immediate(conn); /* it was an error; give up on flushing */

Index: main.c
===================================================================
RCS file: /home/or/cvsroot/tor/src/or/main.c,v
retrieving revision 1.566
retrieving revision 1.567
diff -u -d -r1.566 -r1.567
--- main.c	4 Oct 2005 22:34:09 -0000	1.566
+++ main.c	5 Oct 2005 00:22:56 -0000	1.567
@@ -577,8 +577,9 @@
            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.",
+    if (conn->purpose == DIR_PURPOSE_FETCH_SERVERDESC &&
+        buf_datalen(conn->inbuf)>=(24*1024)) {
+      log_fn(LOG_NOTICE, "Expired a wedged directory connection that had already downloaded %d bytes of descriptors.  If this happens often, please file a bug report.",
              buf_datalen(conn->inbuf));
     }
     connection_mark_for_close(conn);



More information about the tor-commits mailing list