summaryrefslogtreecommitdiff
path: root/src/or/rendcommon.c
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2004-04-08 05:08:27 +0000
committerRoger Dingledine <arma@torproject.org>2004-04-08 05:08:27 +0000
commit4122e2de114cea4299691aa0fb98a7a517a6e466 (patch)
tree510acc914c41e6ee189359169ca2a14941a0c5e7 /src/or/rendcommon.c
parentbb46d782ab6943fbceee807a12b744db0fdbe712 (diff)
downloadtor-4122e2de114cea4299691aa0fb98a7a517a6e466.tar.gz
tor-4122e2de114cea4299691aa0fb98a7a517a6e466.zip
stop being so eager to have rend_cache_store reject the
service descriptor svn:r1566
Diffstat (limited to 'src/or/rendcommon.c')
-rw-r--r--src/or/rendcommon.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/or/rendcommon.c b/src/or/rendcommon.c
index f82becb4ad..ac774b8b85 100644
--- a/src/or/rendcommon.c
+++ b/src/or/rendcommon.c
@@ -213,7 +213,8 @@ int rend_cache_lookup_desc(char *query, const char **desc, int *desc_len)
/* Calculate desc's service id, and store it.
- * Return -1 if it's malformed or otherwise rejected, else return 0.
+ * Return -1 if it's malformed or otherwise rejected and you
+ * want the caller to fail, else return 0.
*/
int rend_cache_store(char *desc, int desc_len)
{
@@ -245,15 +246,15 @@ int rend_cache_store(char *desc, int desc_len)
}
e = (rend_cache_entry_t*) strmap_get_lc(rend_cache, query);
if (e && e->parsed->timestamp > parsed->timestamp) {
- log_fn(LOG_WARN,"We already have a newer service descriptor with the same ID");
+ log_fn(LOG_INFO,"We already have a newer service descriptor with the same ID");
rend_service_descriptor_free(parsed);
- return -1;
+ return 0;
}
if (e && e->len == desc_len && !memcmp(desc,e->desc,desc_len)) {
- log_fn(LOG_WARN,"We already have this service descriptor");
+ log_fn(LOG_INFO,"We already have this service descriptor");
e->received = time(NULL);
rend_service_descriptor_free(parsed);
- return -1;
+ return 0;
}
if (!e) {
e = tor_malloc_zero(sizeof(rend_cache_entry_t));