]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
bugfix: give dir_conn a state before building the bridge, so it has
authorRoger Dingledine <arma@torproject.org>
Sat, 17 Apr 2004 20:19:43 +0000 (20:19 +0000)
committerRoger Dingledine <arma@torproject.org>
Sat, 17 Apr 2004 20:19:43 +0000 (20:19 +0000)
a state if things fail

svn:r1660

src/or/directory.c

index b7bcf3c909fe67b000e0a5d5d757ddb73d9eab67..a8aa296a25483fc309bb68766563d7d9e82c2972 100644 (file)
@@ -58,12 +58,12 @@ void directory_initiate_command(routerinfo_t *router, int purpose,
   /* queue the command on the outbuf */
   directory_send_command(conn, purpose, payload, payload_len);
 
+  /* give it an initial state */
+  conn->state = DIR_CONN_STATE_CONNECTING;
+
   if(purpose == DIR_PURPOSE_FETCH_DIR ||
      purpose == DIR_PURPOSE_UPLOAD_DIR) {
-
     /* then we want to connect directly */
-    conn->state = DIR_CONN_STATE_CONNECTING;
-
     switch(connection_connect(conn, conn->address, conn->addr, conn->port)) {
       case -1:
         router_mark_as_down(conn->nickname); /* don't try him again */