]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
break rend_client_desc_fetched out of connection_mark_for_close
authorRoger Dingledine <arma@torproject.org>
Wed, 12 May 2004 20:36:44 +0000 (20:36 +0000)
committerRoger Dingledine <arma@torproject.org>
Wed, 12 May 2004 20:36:44 +0000 (20:36 +0000)
svn:r1856

src/or/connection.c
src/or/main.c
src/or/or.h

index a50215d471e94b5896a7c6ca63632bd98b28c864..009f6d235ab61617478a717a54026a51d5d43173 100644 (file)
@@ -168,6 +168,15 @@ void connection_free_all(void) {
     connection_free(carray[i]);
 }
 
+void connection_about_to_close_connection(connection_t *conn)
+{
+  if(conn->type == CONN_TYPE_DIR)
+    if(conn->purpose == DIR_PURPOSE_FETCH_RENDDESC)
+      rend_client_desc_fetched(conn->rend_query, 0);
+
+
+}
+
 /** Close the underlying socket for <b>conn</b>, so we don't try to
  * flush it. Must be used in conjunction with (right before)
  * connection_mark_for_close().
@@ -218,11 +227,8 @@ _connection_mark_for_close(connection_t *conn, char reason)
     case CONN_TYPE_AP_LISTENER:
     case CONN_TYPE_DIR_LISTENER:
     case CONN_TYPE_CPUWORKER:
-      /* No special processing needed. */
-      break;
     case CONN_TYPE_DIR:
-      if(conn->purpose == DIR_PURPOSE_FETCH_RENDDESC)
-        rend_client_desc_fetched(conn->rend_query, 0);
+      /* No special processing needed immediately. */
       break;
     case CONN_TYPE_OR:
       /* Remember why we're closing this connection. */
index a2150eb919d9df22c994208aff4ac28fbcccfb83..1c3c5a3d47c4d48b71f22d0b85a36962f4067598 100644 (file)
@@ -313,6 +313,7 @@ static void conn_close_if_marked(int i) {
    * flush and send destroys for all circuits on this conn
    */
   circuit_about_to_close_connection(conn);
+  connection_about_to_close_connection(conn);
   connection_remove(conn);
   if(conn->type == CONN_TYPE_EXIT) {
     assert_connection_edge_not_dns_pending(conn);
index 65d59bccba68e4298451791d498b0fdbe1efaa88..1746d1c7ec243c69825d9429a8ddfd528e73e95b 100644 (file)
@@ -954,6 +954,7 @@ extern char *conn_type_to_string[];
 connection_t *connection_new(int type);
 void connection_free(connection_t *conn);
 void connection_free_all(void);
+void connection_about_to_close_connection(connection_t *conn);
 void connection_close_immediate(connection_t *conn);
 int _connection_mark_for_close(connection_t *conn, char reason);