diff options
author | Roger Dingledine <arma@torproject.org> | 2004-05-12 20:36:44 +0000 |
---|---|---|
committer | Roger Dingledine <arma@torproject.org> | 2004-05-12 20:36:44 +0000 |
commit | 32c42a0ee25fec091ee3e889578ef730b2a37959 (patch) | |
tree | 4bd7d520fe22c5683be5155fdbcc9941865018f7 | |
parent | 44aecf8628f3961033a2fe9e4304402003ba03f5 (diff) | |
download | tor-32c42a0ee25fec091ee3e889578ef730b2a37959.tar.gz tor-32c42a0ee25fec091ee3e889578ef730b2a37959.zip |
break rend_client_desc_fetched out of connection_mark_for_close
svn:r1856
-rw-r--r-- | src/or/connection.c | 14 | ||||
-rw-r--r-- | src/or/main.c | 1 | ||||
-rw-r--r-- | src/or/or.h | 1 |
3 files changed, 12 insertions, 4 deletions
diff --git a/src/or/connection.c b/src/or/connection.c index a50215d471..009f6d235a 100644 --- a/src/or/connection.c +++ b/src/or/connection.c @@ -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. */ diff --git a/src/or/main.c b/src/or/main.c index a2150eb919..1c3c5a3d47 100644 --- a/src/or/main.c +++ b/src/or/main.c @@ -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); diff --git a/src/or/or.h b/src/or/or.h index 65d59bccba..1746d1c7ec 100644 --- a/src/or/or.h +++ b/src/or/or.h @@ -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); |