diff options
author | Roger Dingledine <arma@torproject.org> | 2007-12-15 20:50:56 +0000 |
---|---|---|
committer | Roger Dingledine <arma@torproject.org> | 2007-12-15 20:50:56 +0000 |
commit | 71c84abdff1f8366ba5f3fad6496dd1735273222 (patch) | |
tree | dbace6ca4d4416a70f613d009702bfb71ab35a1c | |
parent | 31324f3e7fc3edcf47f4dac83e687fc50242f2b2 (diff) | |
download | tor-71c84abdff1f8366ba5f3fad6496dd1735273222.tar.gz tor-71c84abdff1f8366ba5f3fad6496dd1735273222.zip |
cleanups on r12825
svn:r12826
-rw-r--r-- | doc/spec/rend-spec.txt | 5 | ||||
-rw-r--r-- | src/or/directory.c | 5 | ||||
-rw-r--r-- | src/or/rendcommon.c | 2 | ||||
-rw-r--r-- | src/or/rendservice.c | 16 |
4 files changed, 9 insertions, 19 deletions
diff --git a/doc/spec/rend-spec.txt b/doc/spec/rend-spec.txt index 90277ded51..63386795a5 100644 --- a/doc/spec/rend-spec.txt +++ b/doc/spec/rend-spec.txt @@ -547,10 +547,7 @@ $Id$ 6 nodes. If the request is unsuccessful, Alice retries the other remaining responsible hidden service directories in a random order. Alice relies on Bob to care about a potential clock skew between the two - by possibly storing two sets of descriptors (see section 1.4). - [XXX what does this mean Bob does in practice, if anything? -RD] - [Cf. last sentence of 1.4. Maybe this reference would be helpful here, - so I added it. -KL] + by possibly storing two sets of descriptors (see end of section 1.4). Alice's OP opens a stream via Tor to the chosen v2 hidden service directory. (She may re-use old circuits for this.) Over this stream, diff --git a/src/or/directory.c b/src/or/directory.c index 1d6f08fbb8..b211414137 100644 --- a/src/or/directory.c +++ b/src/or/directory.c @@ -3107,10 +3107,7 @@ dir_split_resource_into_fingerprints(const char *resource, /** Determine the responsible hidden service directories for the * rend_encoded_v2_service_descriptor_t's in <b>descs</b> and upload them; * <b>service_id</b> and <b>seconds_valid</b> are only passed for logging - * purposes.*/ -/* XXXX020 desc_ids and desc_strs could be merged. Should they? */ -/* I guess they should. -KL */ -/* And now they are. -KL */ + * purposes. */ void directory_post_to_hs_dir(smartlist_t *descs, const char *service_id, int seconds_valid) diff --git a/src/or/rendcommon.c b/src/or/rendcommon.c index dd2a63bca2..072b1611d1 100644 --- a/src/or/rendcommon.c +++ b/src/or/rendcommon.c @@ -320,7 +320,7 @@ void rend_encoded_v2_service_descriptor_free( rend_encoded_v2_service_descriptor_t *desc) { - if (desc->desc_str) tor_free(desc->desc_str); + tor_free(desc->desc_str); tor_free(desc); } diff --git a/src/or/rendservice.c b/src/or/rendservice.c index 0341d7997b..e8764bc8e9 100644 --- a/src/or/rendservice.c +++ b/src/or/rendservice.c @@ -325,13 +325,7 @@ rend_config_services(or_options_t *options, int validate_only) version = atoi(version_str); versions_bitmask |= 1 << version; } - /* XXX020 Karsten: do you really want to overwrite the - * descriptor_version in the second line? Perhaps if both bits - * are set you want to leave it at -1? -RD */ - /* If both bits are set, versions_bitmask will be (1<<0) + (1<<2), - * so that neither condition will be true, leaving descriptor_version - * set to -1. Does the following comment make it less confusing? -KL */ - /* If version 0 XOR 2 was set, change descriptor_version to that + /* If exactly one version is set, change descriptor_version to that * value; otherwise leave it at -1. */ if (versions_bitmask == 1 << 0) service->descriptor_version = 0; if (versions_bitmask == 1 << 2) service->descriptor_version = 2; @@ -1114,6 +1108,7 @@ upload_service_descriptor(rend_service_t *service) if (seconds_valid < 0) { log_warn(LD_BUG, "Internal error: couldn't encode service descriptor; " "not uploading."); + smartlist_free(descs); return; } /* Post the current descriptors to the hidden service directories. */ @@ -1122,7 +1117,7 @@ upload_service_descriptor(rend_service_t *service) serviceid); directory_post_to_hs_dir(descs, serviceid, seconds_valid); /* Free memory for descriptors. */ - for (i = 0; i < REND_NUMBER_OF_NON_CONSECUTIVE_REPLICAS; i++) + for (i = 0; i < smartlist_len(descs); i++) rend_encoded_v2_service_descriptor_free(smartlist_get(descs, i)); smartlist_clear(descs); /* Update next upload time. */ @@ -1141,14 +1136,15 @@ upload_service_descriptor(rend_service_t *service) if (seconds_valid < 0) { log_warn(LD_BUG, "Internal error: couldn't encode service " "descriptor; not uploading."); + smartlist_free(descs); return; } directory_post_to_hs_dir(descs, serviceid, seconds_valid); /* Free memory for descriptors. */ - for (i = 0; i < REND_NUMBER_OF_NON_CONSECUTIVE_REPLICAS; i++) + for (i = 0; i < smartlist_len(descs); i++) rend_encoded_v2_service_descriptor_free(smartlist_get(descs, i)); - smartlist_free(descs); } + smartlist_free(descs); uploaded = 1; log_info(LD_REND, "Successfully uploaded v2 rend descriptors!"); } |