aboutsummaryrefslogtreecommitdiff
path: root/src/or/rephist.c
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2008-04-16 00:10:39 +0000
committerRoger Dingledine <arma@torproject.org>2008-04-16 00:10:39 +0000
commit2b4ff1718f846b438229ea8419b3b5e8b0b192a5 (patch)
tree8eada6b2a293a7680d46b56004cd10d1362760c1 /src/or/rephist.c
parent20f927c2dd62c6a2f3767fdcd570c6b0b85d374a (diff)
downloadtor-2b4ff1718f846b438229ea8419b3b5e8b0b192a5.tar
tor-2b4ff1718f846b438229ea8419b3b5e8b0b192a5.tar.gz
forward-port r14375 and try to make it less likely to happen again
svn:r14377
Diffstat (limited to 'src/or/rephist.c')
-rw-r--r--src/or/rephist.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/or/rephist.c b/src/or/rephist.c
index c7d44743e..64228b392 100644
--- a/src/or/rephist.c
+++ b/src/or/rephist.c
@@ -1380,7 +1380,7 @@ static smartlist_t *predicted_ports_times=NULL;
* some circuits open that will exit to this port.
*/
static void
-add_predicted_port(uint16_t port, time_t now)
+add_predicted_port(time_t now, uint16_t port)
{
/* XXXX we could just use uintptr_t here, I think. */
uint16_t *tmp_port = tor_malloc(sizeof(uint16_t));
@@ -1401,7 +1401,7 @@ predicted_ports_init(void)
{
predicted_ports_list = smartlist_create();
predicted_ports_times = smartlist_create();
- add_predicted_port(80, time(NULL)); /* add one to kickstart us */
+ add_predicted_port(time(NULL), 80); /* add one to kickstart us */
}
/** Free whatever memory is needed for predicting which ports will
@@ -1423,7 +1423,7 @@ predicted_ports_free(void)
* future and making exit circuits to anticipate that.
*/
void
-rep_hist_note_used_port(uint16_t port, time_t now)
+rep_hist_note_used_port(time_t now, uint16_t port)
{
int i;
uint16_t *tmp_port;
@@ -1444,7 +1444,7 @@ rep_hist_note_used_port(uint16_t port, time_t now)
}
}
/* it's not there yet; we need to add it */
- add_predicted_port(port, now);
+ add_predicted_port(now, port);
}
/** For this long after we've seen a request for a given port, assume that
@@ -1491,7 +1491,7 @@ rep_hist_get_predicted_ports(time_t now)
void
rep_hist_note_used_resolve(time_t now)
{
- rep_hist_note_used_port(80, now);
+ rep_hist_note_used_port(now, 80);
}
/** The last time at which we needed an internal circ. */