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

svn:r5187
This commit is contained in:
Nick Mathewson 2005-10-05 00:22:56 +00:00
parent 42e17182da
commit a608905070
2 changed files with 6 additions and 4 deletions

View file

@ -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 */

View file

@ -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);