diff options
author | Nick Mathewson <nickm@torproject.org> | 2020-08-03 11:49:09 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2020-08-03 11:49:09 -0400 |
commit | aef9c0f5809d2978f16f08ada1f3e482bd4dbb6f (patch) | |
tree | 515da617c2ac51de39c7d143dd6cc16023319f7b /src/test/test_channel.c | |
parent | 18d2c7c5d7eb0441d891fb7642fbbabde6c53cf2 (diff) | |
parent | 435f31aed34e9b58d1e8d9f460e6d2e3c6714fbc (diff) | |
download | tor-aef9c0f5809d2978f16f08ada1f3e482bd4dbb6f.tar.gz tor-aef9c0f5809d2978f16f08ada1f3e482bd4dbb6f.zip |
Merge branch 'ticket40081_035' into ticket40081_044
Resolves conflicts:
src/core/or/channel.c
src/test/test_channel.c
Diffstat (limited to 'src/test/test_channel.c')
-rw-r--r-- | src/test/test_channel.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/src/test/test_channel.c b/src/test/test_channel.c index 849cc497fc..83b69cc80b 100644 --- a/src/test/test_channel.c +++ b/src/test/test_channel.c @@ -44,7 +44,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; @@ -337,14 +336,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; } @@ -1360,6 +1355,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. */ @@ -1463,8 +1461,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); |