mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-14 07:03:44 +01:00
call directory_has_arrived has arrived every time we get
a new directory, not just the first time svn:r1581
This commit is contained in:
parent
c256f2c3a1
commit
c5bef32d95
@ -11,7 +11,6 @@ static int directory_handle_command(connection_t *conn);
|
|||||||
/********* START VARIABLES **********/
|
/********* START VARIABLES **********/
|
||||||
|
|
||||||
extern or_options_t options; /* command-line and config-file options */
|
extern or_options_t options; /* command-line and config-file options */
|
||||||
extern int has_fetched_directory;
|
|
||||||
|
|
||||||
char rend_publish_string[] = "/rendezvous/publish";
|
char rend_publish_string[] = "/rendezvous/publish";
|
||||||
char rend_fetch_url[] = "/rendezvous/";
|
char rend_fetch_url[] = "/rendezvous/";
|
||||||
@ -243,14 +242,8 @@ int connection_dir_process_inbuf(connection_t *conn) {
|
|||||||
} else {
|
} else {
|
||||||
log_fn(LOG_INFO,"updated routers.");
|
log_fn(LOG_INFO,"updated routers.");
|
||||||
}
|
}
|
||||||
if(options.ORPort) { /* connect to them all */
|
|
||||||
router_retry_connections();
|
|
||||||
}
|
|
||||||
if (has_fetched_directory==0) {
|
|
||||||
has_fetched_directory=1;
|
|
||||||
directory_has_arrived(); /* do things we've been waiting to do */
|
directory_has_arrived(); /* do things we've been waiting to do */
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if(conn->purpose == DIR_PURPOSE_UPLOAD_DIR) {
|
if(conn->purpose == DIR_PURPOSE_UPLOAD_DIR) {
|
||||||
switch(status_code) {
|
switch(status_code) {
|
||||||
|
@ -282,14 +282,22 @@ static void conn_close_if_marked(int i) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* This function is called whenever we successfully pull
|
||||||
|
* down a directory */
|
||||||
void directory_has_arrived(void) {
|
void directory_has_arrived(void) {
|
||||||
|
|
||||||
log_fn(LOG_INFO, "We now have a directory.");
|
log_fn(LOG_INFO, "A directory has arrived.");
|
||||||
|
|
||||||
/* just for testing */
|
/* just for testing */
|
||||||
// directory_initiate_command(router_pick_directory_server(),
|
// directory_initiate_command(router_pick_directory_server(),
|
||||||
// DIR_PURPOSE_FETCH_RENDDESC, "foo", 3);
|
// DIR_PURPOSE_FETCH_RENDDESC, "foo", 3);
|
||||||
|
|
||||||
|
has_fetched_directory=1;
|
||||||
|
|
||||||
|
if(options.ORPort) { /* connect to them all */
|
||||||
|
router_retry_connections();
|
||||||
|
}
|
||||||
|
|
||||||
rend_services_init(); /* get bob to initialize all his hidden services */
|
rend_services_init(); /* get bob to initialize all his hidden services */
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user