mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-12-06 19:41:15 +01:00
be quieter about hidserv descriptors that are too old or too new.
we can't do anything about them anyway. svn:r6073
This commit is contained in:
+3
-2
@@ -1722,8 +1722,9 @@ directory_handle_command_post(connection_t *conn, char *headers,
|
||||
/* rendezvous descriptor post */
|
||||
if (rend_cache_store(body, body_len) < 0) {
|
||||
// char tmp[1024*2+1];
|
||||
log_notice(LD_DIRSERV,"Rejected rend descriptor (length %d) from %s.",
|
||||
(int)body_len, origin);
|
||||
log_fn(LOG_PROTOCOL_WARN, LD_DIRSERV,
|
||||
"Rejected rend descriptor (length %d) from %s.",
|
||||
(int)body_len, origin);
|
||||
#if 0
|
||||
if (body_len <= 1024) {
|
||||
base16_encode(tmp, sizeof(tmp), body, body_len);
|
||||
|
||||
+4
-3
@@ -379,13 +379,14 @@ rend_cache_store(const char *desc, size_t desc_len)
|
||||
tor_snprintf(key, sizeof(key), "%c%s", parsed->version?'1':'0', query);
|
||||
now = time(NULL);
|
||||
if (parsed->timestamp < now-REND_CACHE_MAX_AGE-REND_CACHE_MAX_SKEW) {
|
||||
log_warn(LD_REND,"Service descriptor %s is too old.", safe_str(query));
|
||||
log_fn(LOG_PROTOCOL_WARN, LD_REND,
|
||||
"Service descriptor %s is too old.", safe_str(query));
|
||||
rend_service_descriptor_free(parsed);
|
||||
return -1;
|
||||
}
|
||||
if (parsed->timestamp > now+REND_CACHE_MAX_SKEW) {
|
||||
log_warn(LD_REND,"Service descriptor %s is too far in the future.",
|
||||
safe_str(query));
|
||||
log_fn(LOG_PROTOCOL_WARN, LD_REND,
|
||||
"Service descriptor %s is too far in the future.", safe_str(query));
|
||||
rend_service_descriptor_free(parsed);
|
||||
return -1;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user