When parsing foo.exit, if foo is unknown, and we are leaving circuits unattached, set the chosen_exit field and leave the address empty

svn:r5504
This commit is contained in:
Nick Mathewson
2005-12-05 04:38:21 +00:00
parent 1bf56b452e
commit 98290e4115
+3 -2
View File
@@ -1002,9 +1002,10 @@ connection_ap_handshake_process_socks(connection_t *conn)
}
} else {
struct in_addr in;
routerinfo_t *r = router_get_by_nickname(socks->address, 1);
conn->chosen_exit_name = socks->address;
*socks->address = 0;
routerinfo_t *r = router_get_by_nickname(conn->chosen_exit_name, 1);
if (r) {
conn->chosen_exit_name = tor_strdup(socks->address);
/* XXXX Should this use server->address instead? */
in.s_addr = htonl(r->addr);
strlcpy(socks->address, inet_ntoa(in), sizeof(socks->address));