bugfix: when a resolve fails for a begin request, actually send

the end cell back. also, give a better reason for failure.


svn:r2358
This commit is contained in:
Roger Dingledine 2004-09-21 17:33:05 +00:00
parent ff622786f1
commit d977677aa8

View File

@ -495,10 +495,9 @@ static void dns_found_answer(char *address, uint32_t addr, char outcome) {
/* prevent double-remove. */ /* prevent double-remove. */
pendconn->state = EXIT_CONN_STATE_RESOLVEFAILED; pendconn->state = EXIT_CONN_STATE_RESOLVEFAILED;
if (pendconn->purpose == EXIT_PURPOSE_CONNECT) { if (pendconn->purpose == EXIT_PURPOSE_CONNECT) {
/*XXXX can we safely raise the detach here to happen after we connection_edge_end(pendconn, END_STREAM_REASON_RESOLVEFAILED, pendconn->cpath_layer);
* send the end cell? */ /* This detach must happen after we send the end cell. */
circuit_detach_stream(circuit_get_by_conn(pendconn), pendconn); circuit_detach_stream(circuit_get_by_conn(pendconn), pendconn);
connection_edge_end(pendconn, END_STREAM_REASON_MISC, pendconn->cpath_layer);
} else { } else {
send_resolved_cell(pendconn, RESOLVED_TYPE_ERROR); send_resolved_cell(pendconn, RESOLVED_TYPE_ERROR);
/* This detach must happen after we send the resolved cell. */ /* This detach must happen after we send the resolved cell. */