diff --git a/src/libostree/ostree-repo-pull.c b/src/libostree/ostree-repo-pull.c index 13403d859b..d7f3904f6b 100644 --- a/src/libostree/ostree-repo-pull.c +++ b/src/libostree/ostree-repo-pull.c @@ -3000,11 +3000,9 @@ _ostree_repo_remote_new_fetcher (OstreeRepo *self, const char *remote_name, gboo } } - _ostree_fetcher_set_low_speed_limit (fetcher, (low_speed_limit) ? low_speed_limit - : OPT_LOWSPEEDLIMIT_DEFAULT); - _ostree_fetcher_set_low_speed_time (fetcher, - (low_speed_time) ? low_speed_time : OPT_LOWSPEEDTIME_DEFAULT); - _ostree_fetcher_set_retry_all (fetcher, (retry_all) ? retry_all : OPT_RETRYALL_DEFAULT); + _ostree_fetcher_set_low_speed_limit (fetcher, low_speed_limit); + _ostree_fetcher_set_low_speed_time (fetcher, low_speed_time); + _ostree_fetcher_set_retry_all (fetcher, retry_all); { g_autofree char *tls_ca_path = NULL; @@ -3524,6 +3522,9 @@ ostree_repo_pull_with_options (OstreeRepo *self, const char *remote_name_or_base gboolean opt_gpg_verify_summary_set = FALSE; gboolean opt_collection_refs_set = FALSE; gboolean opt_n_network_retries_set = FALSE; + gboolean opt_low_speed_limit_set = FALSE; + gboolean opt_low_speed_time_set = FALSE; + gboolean opt_retry_all_set = FALSE; gboolean opt_ref_keyring_map_set = FALSE; gboolean disable_sign_verify = FALSE; gboolean disable_sign_verify_summary = FALSE; @@ -3588,9 +3589,12 @@ ostree_repo_pull_with_options (OstreeRepo *self, const char *remote_name_or_base &pull_data->timestamp_check_from_rev); (void)g_variant_lookup (options, "max-metadata-size", "t", &pull_data->max_metadata_size); (void)g_variant_lookup (options, "append-user-agent", "s", &pull_data->append_user_agent); - (void)g_variant_lookup (options, "low-speed-limit-bytes", "u", &pull_data->low_speed_limit); - (void)g_variant_lookup (options, "low-speed-time-seconds", "u", &pull_data->low_speed_time); - (void)g_variant_lookup (options, "retry-all-network-errors", "b", &pull_data->retry_all); + opt_low_speed_limit_set + = g_variant_lookup (options, "low-speed-limit-bytes", "u", &pull_data->low_speed_limit); + opt_low_speed_time_set + = g_variant_lookup (options, "low-speed-time-seconds", "u", &pull_data->low_speed_time); + opt_retry_all_set + = g_variant_lookup (options, "retry-all-network-errors", "b", &pull_data->retry_all); opt_n_network_retries_set = g_variant_lookup (options, "n-network-retries", "u", &pull_data->n_network_retries); opt_ref_keyring_map_set @@ -3665,6 +3669,12 @@ ostree_repo_pull_with_options (OstreeRepo *self, const char *remote_name_or_base if (!opt_n_network_retries_set) pull_data->n_network_retries = DEFAULT_N_NETWORK_RETRIES; + if (!opt_low_speed_limit_set) + pull_data->low_speed_limit = OPT_LOWSPEEDLIMIT_DEFAULT; + if (!opt_low_speed_time_set) + pull_data->low_speed_time = OPT_LOWSPEEDTIME_DEFAULT; + if (!opt_retry_all_set) + pull_data->retry_all = OPT_RETRYALL_DEFAULT; pull_data->repo = self; pull_data->progress = progress;