diff options
author | Nick Mathewson <nickm@torproject.org> | 2005-10-04 22:34:09 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2005-10-04 22:34:09 +0000 |
commit | 42e17182daa828760da8f839211618113c6ffdc4 (patch) | |
tree | 9853ab289bd4c77b47b80a851e2faba97e7229ed /src/or | |
parent | 61ea5168859785207062ca22be403bbac32f49e3 (diff) | |
download | tor-42e17182daa828760da8f839211618113c6ffdc4.tar tor-42e17182daa828760da8f839211618113c6ffdc4.tar.gz |
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.
svn:r5186
Diffstat (limited to 'src/or')
-rw-r--r-- | src/or/directory.c | 6 | ||||
-rw-r--r-- | src/or/main.c | 6 |
2 files changed, 12 insertions, 0 deletions
diff --git a/src/or/directory.c b/src/or/directory.c index 60d34b9ee..19cf41f9d 100644 --- a/src/or/directory.c +++ b/src/or/directory.c @@ -1111,6 +1111,12 @@ connection_dir_reached_eof(connection_t *conn) 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; diff --git a/src/or/main.c b/src/or/main.c index 8cf0032cf..579556ba7 100644 --- a/src/or/main.c +++ b/src/or/main.c @@ -575,6 +575,12 @@ run_connection_housekeeping(int i, time_t now) 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; } |