aboutsummaryrefslogtreecommitdiff
path: root/src/or
diff options
context:
space:
mode:
authorPeter Palfrader <peter@palfrader.org>2008-08-13 12:45:15 +0000
committerPeter Palfrader <peter@palfrader.org>2008-08-13 12:45:15 +0000
commit7eaf5bd848791601be14873f8809a55cfa7f1c7d (patch)
tree0f0156a47ed16d1573903aa3cac29ab1e22499b9 /src/or
parent1adc12546ee920f33389fef65a19435c92fecf9a (diff)
downloadtor-7eaf5bd848791601be14873f8809a55cfa7f1c7d.tar.gz
tor-7eaf5bd848791601be14873f8809a55cfa7f1c7d.zip
Nickm says I'm going to hell, but if I write that in a comment he might just save my soul
svn:r16520
Diffstat (limited to 'src/or')
-rw-r--r--src/or/policies.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/or/policies.c b/src/or/policies.c
index dd0f24fd52..918e941933 100644
--- a/src/or/policies.c
+++ b/src/or/policies.c
@@ -930,6 +930,7 @@ policy_summary_item_t* policy_summary_item_split(policy_summary_item_t* old, uin
/** Create a new exit policy summary, initially only with a single
* port 1-64k item */
+/* XXXX This entire thing is O(N^2). Use an RB-tree if that turns out to matter. */
smartlist_t *
policy_summary_create(void)
{
@@ -971,7 +972,10 @@ policy_summary_item_split(policy_summary_item_t* old, uint16_t new_starts) {
return new;
}
+/* XXXX Nick says I'm going to hell for this. If he feels charitably towards
+ * my immortal soul, he can clean it up himself. */
#define AT(x) ((policy_summary_item_t*)smartlist_get(summary, x))
+
#define REJECT_CUTOFF_COUNT (1<<25)
/* Split an exit policy summary so that prt_min and prt_max
* fall at exactly the start and end of an item respectively.
@@ -983,6 +987,7 @@ policy_summary_split(smartlist_t *summary,
int start_at_index;
int i = 0;
+ /* XXXX Do a binary search if run time matters */
while (AT(i)->prt_max < prt_min)
i++;
if (AT(i)->prt_min != prt_min) {