old or skewed descriptor doesn't mean we failed to parse it

svn:r1373
This commit is contained in:
Roger Dingledine 2004-03-29 23:23:01 +00:00
parent 10b360f188
commit 83c88c55fd
2 changed files with 9 additions and 9 deletions

View File

@ -198,10 +198,10 @@ int connection_dir_process_inbuf(connection_t *conn) {
log_fn(LOG_INFO,"eof (status 200) while reading upload response: finished."); log_fn(LOG_INFO,"eof (status 200) while reading upload response: finished.");
break; break;
case 400: case 400:
log_fn(LOG_WARN,"http status 400 (bad request) from dirserver. Is your clock skewed?"); log_fn(LOG_WARN,"http status 400 (bad request) response from dirserver.");
break; break;
case 403: case 403:
log_fn(LOG_WARN,"http status 403 (unapproved server) from dirserver. Have you mailed arma your identity fingerprint? Are you using the right key?"); log_fn(LOG_WARN,"http status 403 (unapproved server) response from dirserver. Is your clock skewed? Have you mailed arma your identity fingerprint? Are you using the right key?");
break; break;
} }
@ -258,7 +258,7 @@ static int directory_handle_command_post(connection_t *conn,
cp = body; cp = body;
switch(dirserv_add_descriptor(&cp)) { switch(dirserv_add_descriptor(&cp)) {
case -1: case -1:
/* malformed descriptor, or clock is skewed, or something wrong */ /* malformed descriptor, or something wrong */
connection_write_to_buf(answer400, strlen(answer400), conn); connection_write_to_buf(answer400, strlen(answer400), conn);
break; break;
case 0: case 0:

View File

@ -186,8 +186,8 @@ dirserv_free_descriptors()
} }
/* Return 1 if descriptor is well-formed and accepted; /* Return 1 if descriptor is well-formed and accepted;
* 0 if well-formed and server is unapproved; * 0 if well-formed and server or descriptor is unapproved;
* -1 if not well-formed or if clock is skewed or other error. * -1 if not well-formed or other error.
* *
* Update *desc to point after the descriptor if the * Update *desc to point after the descriptor if the
* descriptor is well-formed. * descriptor is well-formed.
@ -248,16 +248,16 @@ dirserv_add_descriptor(const char **desc)
/* Is there too much clock skew? */ /* Is there too much clock skew? */
now = time(NULL); now = time(NULL);
if (ri->published_on > now+ROUTER_ALLOW_SKEW) { if (ri->published_on > now+ROUTER_ALLOW_SKEW) {
log_fn(LOG_WARN, "Publication time for nickname %s is too far in the future; possible clock skew. Not adding", ri->nickname); log_fn(LOG_WARN, "Publication time for nickname %s is too far in the future; possible clock skew. Not adding.", ri->nickname);
routerinfo_free(ri); routerinfo_free(ri);
*desc = end; *desc = end;
return -1; return 0;
} }
if (ri->published_on < now-ROUTER_MAX_AGE) { if (ri->published_on < now-ROUTER_MAX_AGE) {
log_fn(LOG_WARN, "Publication time for router with nickname %s is too far in the past. Not adding", ri->nickname); log_fn(LOG_WARN, "Publication time for router with nickname %s is too far in the past. Not adding.", ri->nickname);
routerinfo_free(ri); routerinfo_free(ri);
*desc = end; *desc = end;
return -1; return 0;
} }
/* Do we already have an entry for this router? */ /* Do we already have an entry for this router? */