mirror of
https://github.com/RubyMetric/chsrc.git
synced 2024-12-29 01:33:40 +08:00
Fix: reset still measure speed
This commit is contained in:
parent
5ec75b379a
commit
68961a7d9c
|
@ -528,17 +528,17 @@ get_target (const char *input, TargetOp code, char *option)
|
|||
if (TargetOp_Set_Source==code)
|
||||
{
|
||||
if (target->setfn) target->setfn(option);
|
||||
else chsrc_error (xy_strjoin (3, "暂未对 ", input, " 实现set功能,邀您帮助: chsrc issue"));
|
||||
else chsrc_error (xy_strjoin (3, "暂未对 ", input, " 实现 set 功能,邀您帮助: chsrc issue"));
|
||||
}
|
||||
else if (TargetOp_Reset_Source==code)
|
||||
{
|
||||
if (target->resetfn) target->resetfn(option);
|
||||
else chsrc_error (xy_strjoin (3, "暂未对 ", input, " 实现reset功能,邀您帮助: chsrc issue"));
|
||||
else chsrc_error (xy_strjoin (3, "暂未对 ", input, " 实现 reset 功能,邀您帮助: chsrc issue"));
|
||||
}
|
||||
else if (TargetOp_Get_Source==code)
|
||||
{
|
||||
if (target->getfn) target->getfn("");
|
||||
else chsrc_error (xy_strjoin (3, "暂未对 ", input, " 实现get功能,邀您帮助: chsrc issue"));
|
||||
else chsrc_error (xy_strjoin (3, "暂未对 ", input, " 实现 get 功能,邀您帮助: chsrc issue"));
|
||||
}
|
||||
else if (TargetOp_List_Config==code)
|
||||
{
|
||||
|
|
|
@ -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,12 +703,9 @@ select_mirror_autoly (Source_t *sources, size_t size, const char *target_name)
|
|||
}
|
||||
|
||||
if (CliOpt_DryRun)
|
||||
/* Dry Run 时,跳过测速 */
|
||||
{
|
||||
/* Dry Run 时,跳过测速 */
|
||||
if (ProgMode_CMD_Reset)
|
||||
return 0; /* 选择默认源 */
|
||||
else
|
||||
return 1; /* 原则第一个源 */
|
||||
return 1; /* 原则第一个源 */
|
||||
}
|
||||
|
||||
bool only_one = false;
|
||||
|
|
Loading…
Reference in New Issue
Block a user