summaryrefslogtreecommitdiff
path: root/src/or/circuituse.c
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2004-07-13 01:25:39 +0000
committerRoger Dingledine <arma@torproject.org>2004-07-13 01:25:39 +0000
commit017d7d1fb3f03cc421186c92bfb2e1350b4b7c0b (patch)
treeec82d8155dc4c904ce2ba1ba77b63e038c468cee /src/or/circuituse.c
parent3294b514d3173ce985ffbc349ce1d681ce2ed6e6 (diff)
downloadtor-017d7d1fb3f03cc421186c92bfb2e1350b4b7c0b.tar.gz
tor-017d7d1fb3f03cc421186c92bfb2e1350b4b7c0b.zip
refuse to build a circuit before the directory has arrived
this will prevent a few of the 'couldn't decrypt onionskin' errors, maybe svn:r2036
Diffstat (limited to 'src/or/circuituse.c')
-rw-r--r--src/or/circuituse.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/or/circuituse.c b/src/or/circuituse.c
index 9b971f599e..d6422d0b54 100644
--- a/src/or/circuituse.c
+++ b/src/or/circuituse.c
@@ -14,6 +14,7 @@ extern or_options_t options; /* command-line and config-file options */
/********* START VARIABLES **********/
extern circuit_t *global_circuitlist; /* from circuitlist.c */
+extern int has_fetched_directory; /* from main.c */
/********* END VARIABLES ************/
@@ -590,6 +591,11 @@ static int n_circuit_failures = 0;
circuit_t *circuit_launch_by_identity(uint8_t purpose, const char *exit_digest)
{
+ if (!has_fetched_directory) {
+ log_fn(LOG_DEBUG,"Haven't fetched directory yet; cancelling circuit launch.");
+ return NULL;
+ }
+
if (n_circuit_failures > MAX_CIRCUIT_FAILURES) {
/* too many failed circs in a row. don't try. */
// log_fn(LOG_INFO,"%d failures so far, not trying.",n_circuit_failures);