diff --git a/src/libostree/ostree-fetcher-curl.c b/src/libostree/ostree-fetcher-curl.c index 3d6941be1e..c4bb9e3b77 100644 --- a/src/libostree/ostree-fetcher-curl.c +++ b/src/libostree/ostree-fetcher-curl.c @@ -82,6 +82,7 @@ struct OstreeFetcher guint32 opt_low_speed_limit; guint32 opt_low_speed_time; gboolean opt_retry_all; + guint32 opt_max_outstanding_fetcher_requests; GMainContext *mainctx; CURLM *multi; @@ -691,6 +692,12 @@ _ostree_fetcher_set_retry_all (OstreeFetcher *self, gboolean opt_retry_all) self->opt_retry_all = opt_retry_all; } +void +_ostree_fetcher_set_max_outstanding_fetcher_requests (OstreeFetcher *self, guint32 opt_max_outstanding_fetcher_requests) +{ + self->opt_max_outstanding_fetcher_requests = opt_max_outstanding_fetcher_requests; +} + void _ostree_fetcher_set_cookie_jar (OstreeFetcher *self, const char *jar_path) { diff --git a/src/libostree/ostree-fetcher-soup.c b/src/libostree/ostree-fetcher-soup.c index c727235c9d..765f41ac33 100644 --- a/src/libostree/ostree-fetcher-soup.c +++ b/src/libostree/ostree-fetcher-soup.c @@ -395,6 +395,12 @@ _ostree_fetcher_set_retry_all (OstreeFetcher *self, gboolean opt_retry_all) // TODO } +void +_ostree_fetcher_set_max_outstanding_fetcher_requests (OstreeFetcher *self, guint32 opt_max_outstanding_fetcher_requests) +{ + self->opt_max_outstanding_fetcher_requests = opt_max_outstanding_fetcher_requests; +} + static void on_request_sent (GObject *object, GAsyncResult *result, gpointer user_data); static void diff --git a/src/libostree/ostree-fetcher-soup3.c b/src/libostree/ostree-fetcher-soup3.c index c503998222..9e8bed1f76 100644 --- a/src/libostree/ostree-fetcher-soup3.c +++ b/src/libostree/ostree-fetcher-soup3.c @@ -398,6 +398,12 @@ _ostree_fetcher_set_retry_all (OstreeFetcher *self, gboolean opt_retry_all) // TODO } +void +_ostree_fetcher_set_max_outstanding_fetcher_requests (OstreeFetcher *self, guint32 opt_max_outstanding_fetcher_requests) +{ + self->opt_max_outstanding_fetcher_requests = opt_max_outstanding_fetcher_requests; +} + static gboolean finish_stream (FetcherRequest *request, GCancellable *cancellable, GError **error) { diff --git a/src/libostree/ostree-repo-pull.c b/src/libostree/ostree-repo-pull.c index 16cafe93fa..d45152039a 100644 --- a/src/libostree/ostree-repo-pull.c +++ b/src/libostree/ostree-repo-pull.c @@ -380,7 +380,7 @@ fetcher_queue_is_full (OtPullData *pull_data) const gboolean fetch_full = ((pull_data->n_outstanding_metadata_fetches + pull_data->n_outstanding_content_fetches + pull_data->n_outstanding_deltapart_fetches) - == max_outstanding_fetcher_requests); + == pull_data->max_outstanding_fetcher_requests); const gboolean deltas_full = (pull_data->n_outstanding_deltapart_fetches == _OSTREE_MAX_OUTSTANDING_DELTAPART_REQUESTS); const gboolean writes_full = ((pull_data->n_outstanding_metadata_write_requests @@ -2936,8 +2936,8 @@ static OstreeFetcher * _ostree_repo_remote_new_fetcher (OstreeRepo *self, const char *remote_name, gboolean gzip, GVariant *extra_headers, const char *append_user_agent, guint32 low_speed_limit, guint32 low_speed_time, - gboolean retry_all, guint32 max_outstanding_fetcher_requests, OstreeFetcherSecurityState *out_state, - GError **error) + gboolean retry_all, guint32 max_outstanding_fetcher_requests, + OstreeFetcherSecurityState *out_state, GError **error) { OstreeFetcher *fetcher = NULL; OstreeFetcherConfigFlags fetcher_flags = 0; @@ -3235,8 +3235,8 @@ reinitialize_fetcher (OtPullData *pull_data, const char *remote_name, GError **e g_clear_object (&pull_data->fetcher); pull_data->fetcher = _ostree_repo_remote_new_fetcher ( pull_data->repo, remote_name, FALSE, pull_data->extra_headers, pull_data->append_user_agent, - pull_data->low_speed_limit, pull_data->low_speed_time, pull_data->retry_all, pull_data->max_outstanding_fetcher_requests, - &pull_data->fetcher_security_state, error); + pull_data->low_speed_limit, pull_data->low_speed_time, pull_data->retry_all, + pull_data->max_outstanding_fetcher_requests, &pull_data->fetcher_security_state, error); if (pull_data->fetcher == NULL) return FALSE; @@ -3602,7 +3602,8 @@ ostree_repo_pull_with_options (OstreeRepo *self, const char *remote_name_or_base opt_retry_all_set = g_variant_lookup (options, "retry-all-network-errors", "b", &pull_data->retry_all); opt_max_outstanding_fetcher_requests_set - = g_variant_lookup (options, "max-outstanding-fetcher-requests", "b", &pull_data->max_outstanding_fetcher_requests); + = g_variant_lookup (options, "max-outstanding-fetcher-requests", "b", + &pull_data->max_outstanding_fetcher_requests); opt_n_network_retries_set = g_variant_lookup (options, "n-network-retries", "u", &pull_data->n_network_retries); opt_ref_keyring_map_set @@ -3684,7 +3685,8 @@ ostree_repo_pull_with_options (OstreeRepo *self, const char *remote_name_or_base if (!opt_retry_all_set) pull_data->retry_all = OPT_RETRYALL_DEFAULT; if (!opt_max_outstanding_fetcher_requests_set) - pull_data->max_outstanding_fetcher_requests = OPT_OSTREE_MAX_OUTSTANDING_FETCHER_REQUESTS_DEFAULT; + pull_data->max_outstanding_fetcher_requests + = OPT_OSTREE_MAX_OUTSTANDING_FETCHER_REQUESTS_DEFAULT; pull_data->repo = self; pull_data->progress = progress; @@ -6379,7 +6381,8 @@ ostree_repo_remote_fetch_summary_with_options (OstreeRepo *self, const char *nam (void)g_variant_lookup (options, "low-speed-limit-bytes", "u", &low_speed_limit); (void)g_variant_lookup (options, "low-speed-time-seconds", "u", &low_speed_time); (void)g_variant_lookup (options, "retry-all-network-errors", "b", &retry_all); - (void)g_variant_lookup (options, "max-outstanding-fetcher-requests", "b", &max_outstanding_fetcher_requests); + (void)g_variant_lookup (options, "max-outstanding-fetcher-requests", "b", + &max_outstanding_fetcher_requests); } if (!ostree_repo_remote_get_gpg_verify_summary (self, name, &gpg_verify_summary, error)) @@ -6391,9 +6394,9 @@ ostree_repo_remote_fetch_summary_with_options (OstreeRepo *self, const char *nam mainctx = _ostree_main_context_new_default (); (void)mainctx; // Used for autocleanup - fetcher - = _ostree_repo_remote_new_fetcher (self, name, TRUE, extra_headers, append_user_agent, - low_speed_limit, low_speed_time, retry_all, max_outstanding_fetcher_requests, NULL, error); + fetcher = _ostree_repo_remote_new_fetcher (self, name, TRUE, extra_headers, append_user_agent, + low_speed_limit, low_speed_time, retry_all, + max_outstanding_fetcher_requests, NULL, error); if (fetcher == NULL) return FALSE;