aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--doc/spec/rend-spec.txt5
-rw-r--r--src/or/directory.c5
-rw-r--r--src/or/rendcommon.c2
-rw-r--r--src/or/rendservice.c16
4 files changed, 9 insertions, 19 deletions
diff --git a/doc/spec/rend-spec.txt b/doc/spec/rend-spec.txt
index 90277ded5..63386795a 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 1d6f08fbb..b21141413 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 dd2a63bca..072b1611d 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 0341d7997..e8764bc8e 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!");
}