[tor-bugs] #21345 [Core Tor/Tor]: Do relays count dir reqs as completed before they're complete?

Tor Bug Tracker & Wiki blackhole at torproject.org
Mon Jan 30 05:41:27 UTC 2017


#21345: Do relays count dir reqs as completed before they're complete?
--------------------------+------------------------------------
 Reporter:  arma          |          Owner:
     Type:  task          |         Status:  new
 Priority:  Medium        |      Milestone:  Tor: 0.3.1.x-final
Component:  Core Tor/Tor  |        Version:
 Severity:  Normal        |     Resolution:
 Keywords:                |  Actual Points:
Parent ID:                |         Points:
 Reviewer:                |        Sponsor:
--------------------------+------------------------------------

Comment (by arma):

 Here's the patch that I applied to my directory mirror to see whether the
 above behavior is happening the way I expected:

 {{{
 diff --git a/src/or/dirserv.c b/src/or/dirserv.c
 index 71dcbb6..595ca0c 100644
 --- a/src/or/dirserv.c
 +++ b/src/or/dirserv.c
 @@ -3655,9 +3655,13 @@
 connection_dirserv_add_dir_bytes_to_outbuf(dir_connection_t *conn)
                              bytes, TO_CONN(conn));
    }
    conn->cached_dir_offset += bytes;
 +  log_notice(LD_DIR, "Added %d bytes to dirreq %ld",
 +             (int)bytes, conn->dirreq_id);
    if (conn->cached_dir_offset == (int)conn->cached_dir->dir_z_len) {
      /* We just wrote the last one; finish up. */
      connection_dirserv_finish_spooling(conn);
 +    log_notice(LD_DIR, "Declaring that dirreq_id %ld is complete",
 +               conn->dirreq_id);
      cached_dir_decref(conn->cached_dir);
      conn->cached_dir = NULL;
    }
 diff --git a/src/or/geoip.c b/src/or/geoip.c
 index 74811ea..afc04c9 100644
 --- a/src/or/geoip.c
 +++ b/src/or/geoip.c
 @@ -817,6 +817,7 @@ geoip_change_dirreq_state(uint64_t dirreq_id,
 dirreq_type_t type,
           new_state == DIRREQ_FLUSHING_DIR_CONN_FINISHED) ||
        (type == DIRREQ_TUNNELED &&
           new_state == DIRREQ_CHANNEL_BUFFER_FLUSHED)) {
 +    log_notice(LD_DIR, "Marked dirreq_id %ld as completed.", dirreq_id);
      tor_gettimeofday(&ent->completion_time);
      ent->completed = 1;
    }
 }}}

--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/21345#comment:2>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online


More information about the tor-bugs mailing list