diff options
author | Roger Dingledine <arma@torproject.org> | 2004-04-01 03:23:28 +0000 |
---|---|---|
committer | Roger Dingledine <arma@torproject.org> | 2004-04-01 03:23:28 +0000 |
commit | d01497cf3cb6e3c890e49953d5becd745a5222e5 (patch) | |
tree | 41f3ac31f1ce1e9067ffa48f8f4171d31c070cf7 /src/or/router.c | |
parent | 35f531b94febe2a91447fefaed4ea6751d55a1cb (diff) | |
download | tor-d01497cf3cb6e3c890e49953d5becd745a5222e5.tar tor-d01497cf3cb6e3c890e49953d5becd745a5222e5.tar.gz |
outline what bob does to initialize his hidden services
let circuit_launch_new return the circ it just made
svn:r1424
Diffstat (limited to 'src/or/router.c')
-rw-r--r-- | src/or/router.c | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/src/or/router.c b/src/or/router.c index 160ca128d..59b257c97 100644 --- a/src/or/router.c +++ b/src/or/router.c @@ -236,26 +236,30 @@ void router_retry_connections(void) { } } -void router_upload_desc_to_dirservers(void) { - int i; - routerinfo_t *router; - routerlist_t *rl; +void router_upload_dir_desc_to_dirservers(void) { const char *s; - router_get_routerlist(&rl); - if(!rl) - return; - s = router_get_my_descriptor(); if (!s) { log_fn(LOG_WARN, "No descriptor; skipping upload"); return; } + router_post_to_dirservers(DIR_PURPOSE_UPLOAD_DIR, s, strlen(s)); +} + +void router_post_to_dirservers(uint8_t purpose, const char *payload, int payload_len) { + int i; + routerinfo_t *router; + routerlist_t *rl; + + router_get_routerlist(&rl); + if(!rl) + return; for(i=0;i<rl->n_routers;i++) { router = rl->routers[i]; if(router->dir_port > 0) - directory_initiate_command(router, DIR_PURPOSE_UPLOAD_DIR, s, strlen(s)); + directory_initiate_command(router, purpose, payload, payload_len); } } |