summaryrefslogtreecommitdiff
path: root/src/or/connection_exit.c
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2003-08-14 03:52:51 +0000
committerRoger Dingledine <arma@torproject.org>2003-08-14 03:52:51 +0000
commit88edae94076cc39d40a39f80b2d6ddadc88fe324 (patch)
tree1c7024e5218344b7802a69787fbc37a724f33362 /src/or/connection_exit.c
parente1f2693d05b71e7c137638527848f053440f4482 (diff)
downloadtor-88edae94076cc39d40a39f80b2d6ddadc88fe324.tar.gz
tor-88edae94076cc39d40a39f80b2d6ddadc88fe324.zip
start refactoring dnsworker so testing won't be so darn hard
add NumCpus config variable in preparation for cpuworkers hardcode /etc/torrc path for config (simplifies win32 port) improve exit policy debugging during router entry parsing svn:r397
Diffstat (limited to 'src/or/connection_exit.c')
-rw-r--r--src/or/connection_exit.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/or/connection_exit.c b/src/or/connection_exit.c
index f674404028..1daf9ad8f9 100644
--- a/src/or/connection_exit.c
+++ b/src/or/connection_exit.c
@@ -51,13 +51,17 @@ int connection_exit_begin_conn(cell_t *cell, circuit_t *circ) {
circ->n_streams = n_stream;
/* send it off to the gethostbyname farm */
- if(dns_resolve(n_stream) < 0) {
- log_fn(LOG_DEBUG,"Couldn't queue resolve request.");
- connection_remove(n_stream);
- connection_free(n_stream);
- return 0;
+ switch(dns_resolve(n_stream)) {
+ case 1: /* resolve worked */
+ if(connection_exit_connect(n_stream) >= 0)
+ return 0;
+ /* else fall through */
+ case -1: /* resolve failed */
+ log_fn(LOG_DEBUG,"Couldn't queue resolve request.");
+ connection_remove(n_stream);
+ connection_free(n_stream);
+ case 0: /* resolve added to pending list */
}
-
return 0;
}