aboutsummaryrefslogtreecommitdiff
path: root/src/or/connection_ap.c
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2003-04-19 00:24:17 +0000
committerRoger Dingledine <arma@torproject.org>2003-04-19 00:24:17 +0000
commitffae44aafd4ea988d8ae7d72fdad350e953c165a (patch)
treee5bfd43c22c57cc421775a973ef5d8f1389b4e24 /src/or/connection_ap.c
parentf8c633997982118a6d379a67101d776859143d0b (diff)
downloadtor-ffae44aafd4ea988d8ae7d72fdad350e953c165a.tar
tor-ffae44aafd4ea988d8ae7d72fdad350e953c165a.tar.gz
bugfix: don't segfault if there's no valid circuit open
svn:r253
Diffstat (limited to 'src/or/connection_ap.c')
-rw-r--r--src/or/connection_ap.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/or/connection_ap.c b/src/or/connection_ap.c
index 7dfa1ccc5..c9e99d5bc 100644
--- a/src/or/connection_ap.c
+++ b/src/or/connection_ap.c
@@ -95,15 +95,14 @@ int ap_handshake_process_socks(connection_t *conn) {
/* find the circuit that we should use, if there is one. */
circ = circuit_get_newest_by_edge_type(EDGE_AP);
- circ->dirty = 1;
-
- /* now we're all ready to make an onion or send a begin */
if(!circ) {
log(LOG_INFO,"ap_handshake_process_socks(): No circuit ready. Closing.");
return -1;
}
+ circ->dirty = 1;
+
/* add it into the linked list of topics on this circuit */
log(LOG_DEBUG,"ap_handshake_process_socks(): attaching new conn to circ. n_aci %d.", circ->n_aci);
conn->next_topic = circ->p_conn;