Просмотр исходного кода

bugfix: give dir_conn a state before building the bridge, so it has
a state if things fail


svn:r1660

Roger Dingledine 22 лет назад
Родитель
Сommit
14c30fe9fa
1 измененных файлов с 3 добавлено и 3 удалено
  1. 3 3
      src/or/directory.c

+ 3 - 3
src/or/directory.c

@@ -58,12 +58,12 @@ void directory_initiate_command(routerinfo_t *router, int purpose,
   /* queue the command on the outbuf */
   /* queue the command on the outbuf */
   directory_send_command(conn, purpose, payload, payload_len);
   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 ||
   if(purpose == DIR_PURPOSE_FETCH_DIR ||
      purpose == DIR_PURPOSE_UPLOAD_DIR) {
      purpose == DIR_PURPOSE_UPLOAD_DIR) {
-
     /* then we want to connect directly */
     /* then we want to connect directly */
-    conn->state = DIR_CONN_STATE_CONNECTING;
-
     switch(connection_connect(conn, conn->address, conn->addr, conn->port)) {
     switch(connection_connect(conn, conn->address, conn->addr, conn->port)) {
       case -1:
       case -1:
         router_mark_as_down(conn->nickname); /* don't try him again */
         router_mark_as_down(conn->nickname); /* don't try him again */