aboutsummaryrefslogtreecommitdiff
path: root/src/test/test_channel.c
diff options
context:
space:
mode:
authorGeorge Kadianakis <desnacked@riseup.net>2020-08-12 13:23:33 +0300
committerGeorge Kadianakis <desnacked@riseup.net>2020-08-12 13:23:33 +0300
commitc591a0d2466cdc644fd82519f6f1ec32da764287 (patch)
tree8ca4a3798b167d056439a3219e0b11f396f0744d /src/test/test_channel.c
parent2f708079cd912eb70384002ff3ab29ff2d224ed4 (diff)
parent8e9edb93be7771e44352c539abdf0b269ac56fab (diff)
downloadtor-c591a0d2466cdc644fd82519f6f1ec32da764287.tar.gz
tor-c591a0d2466cdc644fd82519f6f1ec32da764287.zip
Merge branch 'maint-0.4.4'
Diffstat (limited to 'src/test/test_channel.c')
-rw-r--r--src/test/test_channel.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/test/test_channel.c b/src/test/test_channel.c
index c7d4343ede..042eb27d9d 100644
--- a/src/test/test_channel.c
+++ b/src/test/test_channel.c
@@ -50,7 +50,6 @@ static int dump_statistics_mock_matches = 0;
static int test_close_called = 0;
static int test_chan_should_be_canonical = 0;
static int test_chan_should_match_target = 0;
-static int test_chan_canonical_should_be_reliable = 0;
static int test_chan_listener_close_fn_called = 0;
static int test_chan_listener_fn_called = 0;
@@ -351,14 +350,10 @@ scheduler_release_channel_mock(channel_t *ch)
}
static int
-test_chan_is_canonical(channel_t *chan, int req)
+test_chan_is_canonical(channel_t *chan)
{
tor_assert(chan);
- if (req && test_chan_canonical_should_be_reliable) {
- return 1;
- }
-
if (test_chan_should_be_canonical) {
return 1;
}
@@ -1374,6 +1369,9 @@ test_channel_for_extend(void *arg)
/* Make it older than chan1. */
chan2->timestamp_created = chan1->timestamp_created - 1;
+ /* Say it's all canonical. */
+ test_chan_should_be_canonical = 1;
+
/* Set channel identities and add it to the channel map. The last one to be
* added is made the first one in the list so the lookup will always return
* that one first. */
@@ -1477,8 +1475,8 @@ test_channel_for_extend(void *arg)
chan2->is_bad_for_new_circs = 0;
/* Non canonical channels. */
+ test_chan_should_be_canonical = 0;
test_chan_should_match_target = 0;
- test_chan_canonical_should_be_reliable = 1;
ret_chan = channel_get_for_extend(digest, &ed_id, &ipv4_addr, &ipv6_addr,
&msg, &launch);
tt_assert(!ret_chan);