Opened 5 years ago

Closed 5 years ago

Last modified 4 years ago

#14222 closed defect (fixed)

rend_cache_entry_t->received is never used; remove?

Reported by: arma Owned by:
Priority: Medium Milestone: Tor: 0.2.6.x-final
Component: Core Tor/Tor Version:
Severity: Keywords: tor-hs
Cc: Actual Points:
Parent ID: Points:
Reviewer: Sponsor: SponsorR

Description

diff --git a/src/or/or.h b/src/or/or.h
index 8a15529..5ecd5f3 100644
--- a/src/or/or.h
+++ b/src/or/or.h
@@ -4962,7 +4962,6 @@ typedef struct rend_service_descriptor_t {
 /** A cached rendezvous descriptor. */
 typedef struct rend_cache_entry_t {
   size_t len; /**< Length of <b>desc</b> */
-  time_t received; /**< When was the descriptor received? */
   time_t last_served; /**< When did we last write this one to somebody?
                        * (HSDir only) */
   char *desc; /**< Service descriptor */
diff --git a/src/or/rendcommon.c b/src/or/rendcommon.c
index 88d9aab..f83d9d5 100644
--- a/src/or/rendcommon.c
+++ b/src/or/rendcommon.c
@@ -1058,7 +1058,6 @@ rend_cache_store_v2_desc_as_dir(const char *desc)
     if (e && !strcmp(desc, e->desc)) {
       log_info(LD_REND, "We already have this service descriptor with desc "
                         "ID %s.", safe_str(desc_id_base32));
-      e->received = time(NULL);
       goto skip;
     }
     /* Store received descriptor. */
@@ -1075,7 +1074,6 @@ rend_cache_store_v2_desc_as_dir(const char *desc)
       rend_service_descriptor_free(e->parsed);
       tor_free(e->desc);
     }
-    e->received = time(NULL);
     e->parsed = parsed;
     e->desc = tor_strndup(current_desc, encoded_size);
     e->len = encoded_size;
@@ -1261,7 +1259,6 @@ rend_cache_store_v2_desc_as_client(const char *desc,
   if (e && !strcmp(desc, e->desc)) {
     log_info(LD_REND,"We already have this service descriptor %s.",
              safe_str_client(service_id));
-    e->received = time(NULL);
     goto okay;
   }
   if (!e) {
@@ -1272,7 +1269,6 @@ rend_cache_store_v2_desc_as_client(const char *desc,
     rend_service_descriptor_free(e->parsed);
     tor_free(e->desc);
   }
-  e->received = time(NULL);
   e->parsed = parsed;
   e->desc = tor_malloc_zero(encoded_size + 1);
   strlcpy(e->desc, desc, encoded_size + 1);

The field of the struct is written to but never used. Did we have a plan for it? Or should we simplify and get rid of it?

Child Tickets

Change History (3)

comment:1 Changed 5 years ago by arma

Summary: rend_cache_entry_t->received is never used; remove/rend_cache_entry_t->received is never used; remove?

comment:2 Changed 5 years ago by nickm

Milestone: Tor: 0.2.???Tor: 0.2.6.x-final
Resolution: fixed
Status: newclosed

Applied patch to remove it.

comment:3 Changed 4 years ago by dgoulet

Keywords: SponsorR removed
Sponsor: SponsorR
Note: See TracTickets for help on using tickets.