From 73aa8f274f8ce5ef6caefebaf2d9793e8b3959cb Mon Sep 17 00:00:00 2001 From: Roger Dingledine Date: Tue, 21 Sep 2004 17:33:05 +0000 Subject: [PATCH] bugfix: when a resolve fails for a begin request, actually send the end cell back. also, give a better reason for failure. svn:r2358 --- trunk/src/or/dns.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/trunk/src/or/dns.c b/trunk/src/or/dns.c index 19dd0e1520..3534de1b08 100644 --- a/trunk/src/or/dns.c +++ b/trunk/src/or/dns.c @@ -495,10 +495,9 @@ static void dns_found_answer(char *address, uint32_t addr, char outcome) { /* prevent double-remove. */ pendconn->state = EXIT_CONN_STATE_RESOLVEFAILED; if (pendconn->purpose == EXIT_PURPOSE_CONNECT) { - /*XXXX can we safely raise the detach here to happen after we - * send the end cell? */ + connection_edge_end(pendconn, END_STREAM_REASON_RESOLVEFAILED, pendconn->cpath_layer); + /* This detach must happen after we send the end cell. */ circuit_detach_stream(circuit_get_by_conn(pendconn), pendconn); - connection_edge_end(pendconn, END_STREAM_REASON_MISC, pendconn->cpath_layer); } else { send_resolved_cell(pendconn, RESOLVED_TYPE_ERROR); /* This detach must happen after we send the resolved cell. */