aboutsummaryrefslogtreecommitdiff
path: root/src/or/rendservice.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2007-10-31 20:48:08 +0000
committerNick Mathewson <nickm@torproject.org>2007-10-31 20:48:08 +0000
commitfcd42ebef4f56b15af7f7407d48e41d1440dac35 (patch)
tree2ca654decaaf3eca110e8889c6084038c1944409 /src/or/rendservice.c
parent779b615bc272b287436398ae59afcf1ee19154d6 (diff)
downloadtor-fcd42ebef4f56b15af7f7407d48e41d1440dac35.tar.gz
tor-fcd42ebef4f56b15af7f7407d48e41d1440dac35.zip
r16301@catbus: nickm | 2007-10-31 16:43:49 -0400
A couple of small tweaks to karsten's latest patch, and note an issue with using a bitmap to represent a single int. svn:r12300
Diffstat (limited to 'src/or/rendservice.c')
-rw-r--r--src/or/rendservice.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/or/rendservice.c b/src/or/rendservice.c
index e9e4a3e134..d1b1932f0d 100644
--- a/src/or/rendservice.c
+++ b/src/or/rendservice.c
@@ -56,11 +56,14 @@ typedef struct rend_service_t {
time_t intro_period_started;
int n_intro_circuits_launched; /**< count of intro circuits we have
* established in this period. */
+ /* DOCDOC undocumented versions */
rend_service_descriptor_t *desc;
time_t desc_is_dirty;
time_t next_upload_time;
+ /* XXXX020 A service never actually has both descriptor versions; perhaps
+ * this should be an int rather than in intmax. */
int descriptor_versions; /**< bitmask of rendezvous descriptor versions
- * that will be published. */
+ * that will be published. "0" means "default." */
} rend_service_t;
/** A list of rend_service_t's for services run on this OP.
@@ -454,9 +457,9 @@ rend_service_load_keys(void)
return 0;
}
-/** Return the service whose public key has a digest of <b>digest</b>
- * and which publishes descriptors of the given <b>versions</b> bitmask.
- * Return NULL if no such service exists.
+/** Return the service whose public key has a digest of <b>digest</b> and
+ * which publishes exactly the descriptor of the given <b>versions</b>
+ * bitmask. Return NULL if no such service exists.
*/
static rend_service_t *
rend_service_get_by_pk_digest_and_version(const char* digest,
@@ -810,7 +813,8 @@ rend_service_launch_establish_intro(rend_service_t *service,
if (!(service->descriptor_versions & 1)) {
launched->intro_key = crypto_new_pk_env();
tor_assert(!crypto_pk_generate_key(launched->intro_key));
- strmap_set(service->intro_keys, nickname, launched->intro_key);
+ strmap_set(service->intro_keys, nickname,
+ crypto_pk_dup_key(launched->intro_key));
}
if (launched->_base.state == CIRCUIT_STATE_OPEN)
rend_service_intro_has_opened(launched);