[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[or-cvs] stop being so eager to have rend_cache_store reject the



Update of /home/or/cvsroot/src/or
In directory moria.mit.edu:/home2/arma/work/onion/cvs/src/or

Modified Files:
	rendcommon.c 
Log Message:
stop being so eager to have rend_cache_store reject the
service descriptor


Index: rendcommon.c
===================================================================
RCS file: /home/or/cvsroot/src/or/rendcommon.c,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -d -r1.23 -r1.24
--- rendcommon.c	8 Apr 2004 04:47:39 -0000	1.23
+++ rendcommon.c	8 Apr 2004 05:08:27 -0000	1.24
@@ -213,7 +213,8 @@
 
 
 /* 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 @@
   }
   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));