Pārlūkot izejas kodu

Give a less frequent and more helpful warning on failed serverdesc downloads

svn:r5187
Nick Mathewson 20 gadi atpakaļ
vecāks
revīzija
a608905070
2 mainītis faili ar 6 papildinājumiem un 4 dzēšanām
  1. 3 2
      src/or/directory.c
  2. 3 2
      src/or/main.c

+ 3 - 2
src/or/directory.c

@@ -1113,8 +1113,9 @@ connection_dir_reached_eof(connection_t *conn)
     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 */

+ 3 - 2
src/or/main.c

@@ -577,8 +577,9 @@ run_connection_housekeeping(int i, time_t now)
            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);