summaryrefslogtreecommitdiff
path: root/src/or/rendcommon.c
diff options
context:
space:
mode:
authorDavid Goulet <dgoulet@ev0ke.net>2015-06-16 13:16:34 -0400
committerDavid Goulet <dgoulet@ev0ke.net>2015-06-16 13:41:42 -0400
commit8acf5255c20c667f32313ee672c85f6ae00a4f87 (patch)
tree7f525513c5238e04f7dcb0726ccf3fefb6183f9a /src/or/rendcommon.c
parent59fa0c2d996621af5c6990534fe9a07864882975 (diff)
downloadtor-8acf5255c20c667f32313ee672c85f6ae00a4f87.tar.gz
tor-8acf5255c20c667f32313ee672c85f6ae00a4f87.zip
Revert "Do not replace a HS descriptor with a different replica of itself"
This reverts commit 9407040c592184e05e45a3c1a00739c2dd302288. Small fix, "e->received" had to be removed since that variable doesn't exist anymore. Signed-off-by: David Goulet <dgoulet@ev0ke.net>
Diffstat (limited to 'src/or/rendcommon.c')
-rw-r--r--src/or/rendcommon.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/or/rendcommon.c b/src/or/rendcommon.c
index 5fdd13efce..6698f2feaf 100644
--- a/src/or/rendcommon.c
+++ b/src/or/rendcommon.c
@@ -1249,12 +1249,18 @@ rend_cache_store_v2_desc_as_client(const char *desc,
/* Do we already have a newer descriptor? */
tor_snprintf(key, sizeof(key), "2%s", service_id);
e = (rend_cache_entry_t*) strmap_get_lc(rend_cache, key);
- if (e && e->parsed->timestamp >= parsed->timestamp) {
- log_info(LD_REND, "We already have a new enough service descriptor for "
+ if (e && e->parsed->timestamp > parsed->timestamp) {
+ log_info(LD_REND, "We already have a newer service descriptor for "
"service ID %s with the same desc ID and version.",
safe_str_client(service_id));
goto okay;
}
+ /* Do we already have this descriptor? */
+ if (e && !strcmp(desc, e->desc)) {
+ log_info(LD_REND,"We already have this service descriptor %s.",
+ safe_str_client(service_id));
+ goto okay;
+ }
if (!e) {
e = tor_malloc_zero(sizeof(rend_cache_entry_t));
strmap_set_lc(rend_cache, key, e);