fix a pair of duplicate mark-for-closes

svn:r1643
This commit is contained in:
Roger Dingledine 2004-04-16 14:26:23 +00:00
parent f84fa39d87
commit ed24a4f807
2 changed files with 3 additions and 4 deletions

View File

@ -1177,6 +1177,7 @@ static int connection_exit_begin_conn(cell_t *cell, circuit_t *circ) {
if(rend_service_set_connection_addr_port(n_stream, circ) < 0) {
log_fn(LOG_INFO,"Didn't find rendezvous service (port %d)",n_stream->port);
connection_mark_for_close(n_stream, END_STREAM_REASON_EXITPOLICY);
circuit_mark_for_close(circ); /* knock the whole thing down, somebody screwed up */
return 0;
}
assert_circuit_ok(circ);

View File

@ -892,14 +892,13 @@ rend_service_set_connection_addr_port(connection_t *conn, circuit_t *circ)
log_fn(LOG_DEBUG,"beginning to hunt for addr/port");
if (base32_encode(serviceid, REND_SERVICE_ID_LEN+1,
circ->rend_pk_digest,10)) {
log_fn(LOG_WARN,"bug: base32 failed");
return -1;
}
service = rend_service_get_by_pk_digest(circ->rend_pk_digest);
if (!service) {
log_fn(LOG_WARN, "Couldn't find any service associated with pk %s on rendezvous circuit %d; closing",
serviceid, circ->n_circ_id);
circuit_mark_for_close(circ);
connection_mark_for_close(conn, 0/*XXX*/);
return -1;
}
for (i = 0; i < smartlist_len(service->ports); ++i) {
@ -910,9 +909,8 @@ rend_service_set_connection_addr_port(connection_t *conn, circuit_t *circ)
return 0;
}
}
log_fn(LOG_WARN, "No virtual port mapping exists for port %d on service %s",
log_fn(LOG_INFO, "No virtual port mapping exists for port %d on service %s",
conn->port,serviceid);
connection_mark_for_close(conn, 0/*XXX*/);
return -1;
}