Fix: reset still measure speed

This commit is contained in:
Aoran Zeng 2024-12-06 11:05:40 +08:00
parent 5ec75b379a
commit 68961a7d9c
No known key found for this signature in database
GPG Key ID: 8F8BA8488E10ED98
2 changed files with 9 additions and 10 deletions

View File

@ -678,13 +678,15 @@ measure_speed_for_every_source (Source_t sources[], int size, double speed_recor
/**
*
*
* @translation Done
*/
#define auto_select_mirror(s) select_mirror_autoly(s##_sources, s##_sources_n, (char*)#s+3)
int
select_mirror_autoly (Source_t *sources, size_t size, const char *target_name)
{
/* reset 时选择默认源 */
if (ProgMode_CMD_Reset)
return 0;
if (!CliOpt_DryRun)
{
char *msg = CliOpt_InEnglish ? "Measuring speed in sequence" : "测速中";
@ -701,11 +703,8 @@ select_mirror_autoly (Source_t *sources, size_t size, const char *target_name)
}
if (CliOpt_DryRun)
{
/* Dry Run 时,跳过测速 */
if (ProgMode_CMD_Reset)
return 0; /* 选择默认源 */
else
{
return 1; /* 原则第一个源 */
}