summaryrefslogtreecommitdiff
path: root/src/or/directory.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2008-12-17 22:58:20 +0000
committerNick Mathewson <nickm@torproject.org>2008-12-17 22:58:20 +0000
commit6693f3253097326abe3a57469690330cd73d2456 (patch)
tree76e53f5552b311e651cf70c6324370cad1e53ebe /src/or/directory.c
parent2ad36f68c8e5bbbc0f284c04f266f80866d2aef9 (diff)
downloadtor-6693f3253097326abe3a57469690330cd73d2456.tar.gz
tor-6693f3253097326abe3a57469690330cd73d2456.zip
Resolve many DOCDOCs.
svn:r17662
Diffstat (limited to 'src/or/directory.c')
-rw-r--r--src/or/directory.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/src/or/directory.c b/src/or/directory.c
index 97613b0f0b..13c3f71ab8 100644
--- a/src/or/directory.c
+++ b/src/or/directory.c
@@ -2179,13 +2179,13 @@ write_http_response_header(dir_connection_t *conn, ssize_t length,
}
#ifdef INSTRUMENT_DOWNLOADS
-/** Map used to keep track of how much data we've up/downloaded in what kind
- * of request. Maps from request type to pointer to uint64_t. */
typedef struct request_t {
- uint64_t bytes;
- uint64_t count;
+ uint64_t bytes; /**< How many bytes have we transferred? */
+ uint64_t count; /**< How many requests have we made? */
} request_t;
+/** Map used to keep track of how much data we've up/downloaded in what kind
+ * of request. Maps from request type to pointer to request_t. */
static strmap_t *request_map = NULL;
static void
@@ -2222,7 +2222,7 @@ note_client_request(int purpose, int compressed, size_t bytes)
tor_free(key);
}
-/** DOCDOC */
+/** Helper: initialize the request map to instrument downloads. */
static void
ensure_request_map_initialized(void)
{
@@ -3394,6 +3394,8 @@ dir_routerdesc_download_failed(smartlist_t *failed, int status_code,
* every 10 or 60 seconds (FOO_DESCRIPTOR_RETRY_INTERVAL) in main.c. */
}
+/** Helper. Compare two fp_pair_t objects, and return -1, 0, or 1 as
+ * appropriate. */
static int
_compare_pairs(const void **a, const void **b)
{
@@ -3405,7 +3407,10 @@ _compare_pairs(const void **a, const void **b)
return memcmp(fp1->second, fp2->second, DIGEST_LEN);
}
-/** DOCDOC */
+/** Divide a string <b>res</b> of the form FP1-FP2+FP3-FP4...[.z], where each
+ * FP is a hex-encoded fingerprint, into a sequence of distinct sorted
+ * fp_pair_t. Skip malformed pairs. On success, return 0 and add those
+ * fp_pair_t into <b>pairs_out</b>. On failure, return -1. */
int
dir_split_resource_into_fingerprint_pairs(const char *res,
smartlist_t *pairs_out)