Fix python and js group

This commit is contained in:
Aoran Zeng
2025-08-10 20:37:36 +08:00
parent efd2ea2712
commit fec96b812b
10 changed files with 21 additions and 96 deletions

View File

@@ -54,6 +54,7 @@ chef_allow_local_mode (Target_t *target, Capability_t cap, const char *explain_z
target->cap_local_explain = xy_strdup (CHINESE ? explain_zh : explain_en);
}
void
chef_forbid_local_mode (Target_t *target)
{
if (!target)

View File

@@ -1094,20 +1094,21 @@ chsrc_set_provider_speed_measure_accuracy (SourceProvider_t *provider, bool accu
static void
chsrc_set_sources_speed_measure_url_with_func (
Target_t *target,
SpeedUrlConstructor_t func,
char *(*func)(const char *url, const char *user_data),
char *user_data)
{
Source_t *sources = &target->sources;
Source_t *sources = target->sources;
int n = target->sources_n;
for (int i=0; i<n; i++)
{
Source_t *src = &sources[i];
ProviderType_t type = src->provider->type;
if (src->url)
{
/* 为空时才修改 或者里面是脏数据 */
if (NULL==src->speed_measure_url || !chef_is_url (src->speed_measure_url))
{
src->speed_measure_url = func (src->url, postfix);
src->speed_measure_url = func (src->url, user_data);
}
}
}
@@ -1121,7 +1122,6 @@ chsrc_set_sources_speed_measure_url_with_func (
static void
chsrc_set_sources_speed_measure_url_with_postfix (Target_t *target, char *postfix)
{
xy_2strjoin (src->url, postfix);
chsrc_set_sources_speed_measure_url_with_func (target, xy_2strjoin, postfix);
}