Skip to content

Commit 48be5f5

Browse files
committed
Notify users
1 parent c0598b2 commit 48be5f5

File tree

4 files changed

+59
-15
lines changed

4 files changed

+59
-15
lines changed

src/chsrc-main.c

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -506,6 +506,33 @@ iterate_targets_ (const char ***array, size_t size, const char *input, const cha
506506

507507
#define iterate_targets(ary, input, target) iterate_targets_(ary, xy_arylen(ary), input, target)
508508

509+
510+
/**
511+
* 我们总是最后告诉用户一些维护信息
512+
*/
513+
void
514+
cli_notify_for_users ()
515+
{
516+
char *msg = "2025-07-11:\n\n"
517+
518+
" 有时,同一镜像站对不同资源的实际服务速度差异,可能比不同镜像站之间的差异还要大。\n\n"
519+
520+
" * 精准测速: 能真实反映您未来使用该资源时的速度,因为它直接测量您关注的那个资源。\n\n"
521+
522+
" * 模糊测速: 仅代表该镜像站提供服务的一个可能速度。因而可能会出现测速数值较高,但实际使用体验不佳的现象。\n\n"
523+
524+
" 因此,当您遇到模糊测速时,请务必向我们提交准确的测速链接,这既能帮助您,也能造福所有用户。\n\n"
525+
526+
" chsrc 是一个自助和共建的项目。 维护者对于不熟悉的生态系统很难提供有价值的贡献。请您将这部分功能视为您的专属,您可以完全掌控和维护它,就像您是唯一的负责人一样。\n";
527+
528+
br();br();
529+
530+
chsrc_note2 (msg);
531+
}
532+
533+
534+
535+
509536
typedef enum {
510537
TargetOp_Get_Source = 1,
511538
TargetOp_Set_Source,
@@ -515,7 +542,7 @@ typedef enum {
515542
} TargetOp;
516543

517544
/**
518-
* 寻找target,并根据`code`执行相应的操作
545+
* 寻找target,并根据 @param:code 执行相应的操作
519546
*
520547
* @param input 用户输入的目标
521548
* @param code 对target要执行的操作
@@ -585,6 +612,14 @@ get_target (const char *input, TargetOp code, char *option)
585612
select_mirror_autoly (target->sources, target->sources_n, input);
586613
return true;
587614
}
615+
616+
if (TargetOp_Set_Source==code
617+
|| TargetOp_Reset_Source==code
618+
|| TargetOp_Measure_Source==code)
619+
{
620+
cli_notify_for_users();
621+
}
622+
588623
return true;
589624
}
590625

src/recipe/lang/Go.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,11 @@ GoProxyIO =
3636
*/
3737
static Source_t pl_go_sources[] =
3838
{
39-
{&pl_go_upstream, "https://proxy.golang.org"},
40-
{&GoProxyCN, "https://goproxy.cn"},
41-
{&Ali, "https://mirrors.aliyun.com/goproxy/"},
42-
{&Huawei, "https://mirrors.huaweicloud.com/goproxy/"},
43-
{&GoProxyIO, "https://goproxy.io"}
39+
{&pl_go_upstream, "https://proxy.golang.org", NULL},
40+
{&GoProxyCN, "https://goproxy.cn", DelegateToMirror},
41+
{&Ali, "https://mirrors.aliyun.com/goproxy/", NULL},
42+
{&Huawei, "https://mirrors.huaweicloud.com/goproxy/", NULL},
43+
{&GoProxyIO, "https://goproxy.io", DelegateToMirror}
4444
};
4545
def_sources_n(pl_go);
4646

src/recipe/lang/Rust/Cargo.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,26 +28,35 @@ static Source_t pl_rust_cargo_sources[] =
2828
{
2929
{&pl_rust_cargo_upstream, "https://github.com/rust-lang/crates.io-index/",
3030
NULL},
31+
3132
{&MirrorZ, "https://mirrors.cernet.edu.cn/crates.io-index/",
3233
NULL},
3334
{&RsProxyCN, "https://rsproxy.cn/index/",
3435
NULL},
3536
{&Ali, "https://mirrors.aliyun.com/crates.io-index/",
3637
"https://mirrors.aliyun.com/crates/api/v1/crates/windows/0.58.0/download"},
38+
3739
{&Zju, "https://mirrors.zju.edu.cn/crates.io-index/",
3840
NULL},
41+
3942
// {&Nju, "https://mirror.nju.edu.cn/git/crates.io-index.git/",
4043
// NULL},
44+
4145
{&Sjtug_Zhiyuan, "https://mirrors.sjtug.sjtu.edu.cn/crates.io-index/",
4246
NULL},
47+
4348
{&Tuna, "https://mirrors.tuna.tsinghua.edu.cn/crates.io-index/",
4449
NULL},
50+
4551
{&Bfsu, "https://mirrors.bfsu.edu.cn/crates.io-index/",
4652
NULL},
53+
4754
{&Ustc, "https://mirrors.ustc.edu.cn/crates.io-index/",
4855
"https://crates-io.proxy.ustclug.org/api/v1/crates/windows/0.58.0/download"},
56+
4957
// {&Hust, "https://mirrors.hust.edu.cn/crates.io-index/",
5058
// NULL},
59+
5160
{&Cqu, "https://mirrors.cqu.edu.cn/crates.io-index/",
5261
NULL}
5362
};

src/recipe/lang/Rust/rustup.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,15 @@ static SourceProvider_t pl_rust_binary_upstream =
1919
* @update 2025-06-17
2020
*/
2121
static Source_t pl_rust_rustup_sources[] = {
22-
{&pl_rust_binary_upstream, "https://static.rust-lang.org"},
23-
{&MirrorZ, "https://mirrors.cernet.edu.cn/rustup"},
24-
{&Tuna, "https://mirrors.tuna.tsinghua.edu.cn/rustup"},
25-
{&Ustc, "https://mirrors.ustc.edu.cn/rust-static"},
26-
{&Nju, "https://mirror.nju.edu.cn/rustup"},
27-
{&Sjtug_Zhiyuan, "https://mirror.sjtu.edu.cn/rust-static"},
28-
{&Zju, "https://mirrors.zju.edu.cn/rustup"},
29-
{&Iscas, "https://mirror.iscas.ac.cn/rustup"},
30-
{&Ali, "https://mirrors.aliyun.com/rustup"},
22+
{&pl_rust_binary_upstream, "https://static.rust-lang.org", NULL},
23+
{&MirrorZ, "https://mirrors.cernet.edu.cn/rustup", NULL},
24+
{&Tuna, "https://mirrors.tuna.tsinghua.edu.cn/rustup", NULL},
25+
{&Ustc, "https://mirrors.ustc.edu.cn/rust-static", NULL},
26+
{&Nju, "https://mirror.nju.edu.cn/rustup", NULL},
27+
{&Sjtug_Zhiyuan, "https://mirror.sjtu.edu.cn/rust-static", NULL},
28+
{&Zju, "https://mirrors.zju.edu.cn/rustup", NULL},
29+
{&Iscas, "https://mirror.iscas.ac.cn/rustup", NULL},
30+
{&Ali, "https://mirrors.aliyun.com/rustup", NULL},
3131
{&RsProxyCN, "https://rsproxy.cn"}};
3232
def_sources_n(pl_rust_rustup);
3333

0 commit comments

Comments
 (0)