Enable cannibalization of circuits for introduction circuits (backport r14166) and actually use introduction circuits that originate from cannibalization afterwards (backports r15332/r15335).

svn:r15459
This commit is contained in:
Karsten Loesing 2008-06-24 20:39:47 +00:00
parent 80f03b67ef
commit 706d1b31a9
3 changed files with 23 additions and 4 deletions

View File

@ -14,6 +14,9 @@ Changes in version 0.2.0.29 - 2008-06-xx
- Fix a macro/CPP interactions that was confusing some compilers:
some GCCs don't like #if/#endif pairs inside macro arguments.
Fix for bug 707.
- Enable cannibalization of circuits for introduction circuits and
actually use introduction circuits that originate from
cannibalization afterwards.
Changes in version 0.2.0.28-rc - 2008-06-13
@ -30,7 +33,7 @@ Changes in version 0.2.0.28-rc - 2008-06-13
- While setting up a hidden service, some valid introduction circuits
were overlooked and abandoned. This might be the reason for
the long delay in making a hidden service available. Bugfix on
0.2.0.13-alpha.
0.2.0.14-alpha.
o Minor features:
- Update to the "June 9 2008" ip-to-country file.

View File

@ -814,9 +814,9 @@ circuit_find_to_cannibalize(uint8_t purpose, extend_info_t *info,
circuit_t *_circ;
origin_circuit_t *best=NULL;
int need_uptime = flags & CIRCLAUNCH_NEED_UPTIME;
int need_capacity = flags & CIRCLAUNCH_NEED_CAPACITY;
int internal = flags & CIRCLAUNCH_IS_INTERNAL;
int need_uptime = (flags & CIRCLAUNCH_NEED_UPTIME) != 0;
int need_capacity = (flags & CIRCLAUNCH_NEED_CAPACITY) != 0;
int internal = (flags & CIRCLAUNCH_IS_INTERNAL) != 0;
log_debug(LD_CIRC,
"Hunting for a circ to cannibalize: purpose %d, uptime %d, "

View File

@ -797,6 +797,22 @@ rend_service_launch_establish_intro(rend_service_t *service,
escaped_safe_str(intro->extend_info->nickname));
return -1;
}
if (memcmp(intro->extend_info->identity_digest,
launched->build_state->chosen_exit->identity_digest, DIGEST_LEN)) {
char cann[HEX_DIGEST_LEN+1], orig[HEX_DIGEST_LEN+1];
base16_encode(cann, sizeof(cann),
launched->build_state->chosen_exit->identity_digest,
DIGEST_LEN);
base16_encode(orig, sizeof(orig),
intro->extend_info->identity_digest, DIGEST_LEN);
log_info(LD_REND, "The intro circuit we just cannibalized ends at $%s, "
"but we requested an intro circuit to $%s. Updating "
"our service.", cann, orig);
extend_info_free(intro->extend_info);
intro->extend_info = extend_info_dup(launched->build_state->chosen_exit);
}
strlcpy(launched->rend_query, service->service_id,
sizeof(launched->rend_query));
memcpy(launched->rend_pk_digest, service->pk_digest, DIGEST_LEN);