summaryrefslogtreecommitdiff
path: root/src/or/rendservice.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2007-12-23 19:15:22 +0000
committerNick Mathewson <nickm@torproject.org>2007-12-23 19:15:22 +0000
commitda06bfb80fdb0f356cd5cf5746c06492afec0f78 (patch)
treed3cffd2f267f30d269bd1ffa223345fb2a817965 /src/or/rendservice.c
parent473725e1a47c65b59dc22d974c0d7dd2d7f7c44c (diff)
downloadtor-da06bfb80fdb0f356cd5cf5746c06492afec0f78.tar.gz
tor-da06bfb80fdb0f356cd5cf5746c06492afec0f78.zip
r15653@tombo: nickm | 2007-12-23 14:15:12 -0500
Refactor circuit_launch* functions to take a bitfield of flags rather than 4 separate nonconsecutive flags arguments. Also, note a possible but in circuit_find_to_cannibalize, which seems to be ignoring its purpose argument. svn:r12948
Diffstat (limited to 'src/or/rendservice.c')
-rw-r--r--src/or/rendservice.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/or/rendservice.c b/src/or/rendservice.c
index e80d5e947e..60bced974d 100644
--- a/src/or/rendservice.c
+++ b/src/or/rendservice.c
@@ -647,9 +647,10 @@ rend_service_introduce(origin_circuit_t *circuit, const char *request,
/* Launch a circuit to alice's chosen rendezvous point.
*/
for (i=0;i<MAX_REND_FAILURES;i++) {
+ int flags = CIRCLAUNCH_NEED_CAPACITY | CIRCLAUNCH_IS_INTERNAL;
+ if (circ_needs_uptime) flags |= CIRCLAUNCH_NEED_UPTIME;
launched = circuit_launch_by_extend_info(
- CIRCUIT_PURPOSE_S_CONNECT_REND, 0, extend_info,
- circ_needs_uptime, 1, 1);
+ CIRCUIT_PURPOSE_S_CONNECT_REND, extend_info, flags);
if (launched)
break;
@@ -728,8 +729,10 @@ rend_service_relaunch_rendezvous(origin_circuit_t *oldcirc)
log_info(LD_REND,"Reattempting rendezvous circuit to '%s'",
oldstate->chosen_exit->nickname);
- newcirc = circuit_launch_by_extend_info(CIRCUIT_PURPOSE_S_CONNECT_REND, 0,
- oldstate->chosen_exit, 0, 1, 1);
+ newcirc = circuit_launch_by_extend_info(CIRCUIT_PURPOSE_S_CONNECT_REND,
+ oldstate->chosen_exit,
+ CIRCLAUNCH_NEED_CAPACITY|CIRCLAUNCH_IS_INTERNAL);
+
if (!newcirc) {
log_warn(LD_REND,"Couldn't relaunch rendezvous circuit to '%s'.",
oldstate->chosen_exit->nickname);
@@ -769,7 +772,9 @@ rend_service_launch_establish_intro(rend_service_t *service,
++service->n_intro_circuits_launched;
launched = circuit_launch_by_extend_info(CIRCUIT_PURPOSE_S_ESTABLISH_INTRO,
- 0, intro->extend_info, 1, 0, 1);
+ intro->extend_info,
+ CIRCLAUNCH_NEED_UPTIME|CIRCLAUNCH_IS_INTERNAL);
+
if (!launched) {
log_info(LD_REND,
"Can't launch circuit to establish introduction at %s.",