aboutsummaryrefslogtreecommitdiff
path: root/src/or/directory.c
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2003-11-10 08:06:55 +0000
committerRoger Dingledine <arma@torproject.org>2003-11-10 08:06:55 +0000
commit1969c8a92f628d6c4dcbd8e179d6a3e8f59bd6e3 (patch)
tree7136cc0b5cd20462b86b220768c2e7912151b68a /src/or/directory.c
parent3c4b4c8cac706ba17d33929ddcc0b0a306adc6b8 (diff)
downloadtor-1969c8a92f628d6c4dcbd8e179d6a3e8f59bd6e3.tar
tor-1969c8a92f628d6c4dcbd8e179d6a3e8f59bd6e3.tar.gz
client now survives going offline better
fix badness in usage() if neither socksport nor orrport is defined, quit obsolete connection_flush_buf() svn:r780
Diffstat (limited to 'src/or/directory.c')
-rw-r--r--src/or/directory.c30
1 files changed, 8 insertions, 22 deletions
diff --git a/src/or/directory.c b/src/or/directory.c
index fb92bf75a..204909ee8 100644
--- a/src/or/directory.c
+++ b/src/or/directory.c
@@ -21,25 +21,16 @@ static int directorylen=0;
void directory_initiate_command(routerinfo_t *router, int command) {
connection_t *conn;
- if(!router) { /* i guess they didn't have one in mind for me to use */
- log_fn(LOG_WARN,"No running dirservers known. This is really bad.");
- /* XXX never again will a directory fetch work. Should we exit here, or what? */
- return;
- }
-
-#if 0 /* there's no problem with parallel get/posts now. whichever 'get' ends
- last is the directory. */
- if(connection_get_by_type(CONN_TYPE_DIR)) { /* there's already a dir conn running */
- log_fn(LOG_DEBUG,"Canceling connect, dir conn already active.");
- return;
- }
-#endif
-
- if(command == DIR_CONN_STATE_CONNECTING_FETCH)
+ if (command == DIR_CONN_STATE_CONNECTING_FETCH)
log_fn(LOG_DEBUG,"initiating directory fetch");
else
log_fn(LOG_DEBUG,"initiating directory upload");
+ if (!router) { /* i guess they didn't have one in mind for me to use */
+ log_fn(LOG_WARN,"No running dirservers known. Not trying.");
+ return;
+ }
+
conn = connection_new(CONN_TYPE_DIR);
/* set up conn so it's got all the data we need to remember */
@@ -47,13 +38,8 @@ void directory_initiate_command(routerinfo_t *router, int command) {
conn->port = router->dir_port;
conn->address = tor_strdup(router->address);
conn->nickname = tor_strdup(router->nickname);
- if (router->identity_pkey)
- conn->identity_pkey = crypto_pk_dup_key(router->identity_pkey);
- else {
- log_fn(LOG_WARN, "No signing key known for dirserver %s; signature won't be checked", conn->address);
- conn->identity_pkey = NULL;
- /* XXX is there really any situation where router doesn't have an identity_pkey? */
- }
+ assert(router->identity_pkey);
+ conn->identity_pkey = crypto_pk_dup_key(router->identity_pkey);
if(connection_add(conn) < 0) { /* no space, forget it */
connection_free(conn);