feat(enginenetx): enable the stats-based policy #1313
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This commit modifies the https-dialer policy we create to take into account stats to generate tactics. As of this commit, the overall policy is as follows:
if
$OONI_HOME/$engine_dir/httpsdialerstatic.conf
exists and contains entries for the endpoint's domain (e.g., "www.example.com:443"), then we unconditionally use it to generate tactics, otherwise;we generate tactics using existing stats and filter only the tactics that are less than one week old (filtering done when loading from the kvstore) and have worked at least once, otherwise;
we generate tactics using known beacons and candidate SNIs with the extra caveat that we're not going to generate a tactic we have generate already in the previous step, otherwise;
we use whatever resolver is configured to lookup for the domain name and generate tactics doing the boring thing of using the resolved IP addrs along with the SNI being equal to the original domain.
Note that this diff fixes a previously untested for bug caused by trying to obtain statistics for an unknow endpoint domain.
Part of ooni/probe#2531