summaryrefslogtreecommitdiff
path: root/src/or/connection.c
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2004-04-05 00:47:48 +0000
committerRoger Dingledine <arma@torproject.org>2004-04-05 00:47:48 +0000
commit7793078dffae64d8d4574a37c6ffa40fb54637c9 (patch)
treeb988080813729ccd28d572bce44e032398bec00a /src/or/connection.c
parenta9813f0210bbf723e19b24c73fb93ecc436efcfb (diff)
downloadtor-7793078dffae64d8d4574a37c6ffa40fb54637c9.tar.gz
tor-7793078dffae64d8d4574a37c6ffa40fb54637c9.zip
alice can now look up bob's service descriptor,
choose an intro point, connect to it, choose a rend point, connect to it and establish a cookie, get an ack from the rendezvous point, and know when both circs are ready for her. APConns don't use conn->purpose anymore don't initiate a renddesc lookup if one is already in progress also fix a buffer overflow in nickname parsing (only exploitable by the operator though) svn:r1471
Diffstat (limited to 'src/or/connection.c')
-rw-r--r--src/or/connection.c21
1 files changed, 18 insertions, 3 deletions
diff --git a/src/or/connection.c b/src/or/connection.c
index 3f0e5cbb5c..471528a49f 100644
--- a/src/or/connection.c
+++ b/src/or/connection.c
@@ -866,6 +866,22 @@ connection_t *connection_get_by_type_state_lastwritten(int type, int state) {
return best;
}
+connection_t *connection_get_by_type_rendquery(int type, char *rendquery) {
+ int i, n;
+ connection_t *conn;
+ connection_t **carray;
+
+ get_connection_array(&carray,&n);
+ for(i=0;i<n;i++) {
+ conn = carray[i];
+ if(conn->type == type &&
+ !conn->marked_for_close &&
+ !rend_cmp_service_ids(rendquery, conn->rend_query))
+ return conn;
+ }
+ return NULL;
+}
+
int connection_is_listener(connection_t *conn) {
if(conn->type == CONN_TYPE_OR_LISTENER ||
conn->type == CONN_TYPE_AP_LISTENER ||
@@ -1026,9 +1042,8 @@ void assert_connection_ok(connection_t *conn, time_t now)
} else {
assert(!conn->socks_request);
}
- if(conn->type != CONN_TYPE_DIR &&
- conn->type != CONN_TYPE_AP) {
- assert(!conn->purpose); /* only used for dir and ap types currently */
+ if(conn->type != CONN_TYPE_DIR) {
+ assert(!conn->purpose); /* only used for dir types currently */
}
switch(conn->type)