Skip to content

Commit

Permalink
builds
Browse files Browse the repository at this point in the history
  • Loading branch information
jmarrero committed Sep 29, 2023
1 parent ada3f51 commit f1cfa47
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 20 deletions.
25 changes: 20 additions & 5 deletions src/libostree/ostree-fetcher-curl.c
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,8 @@ struct OstreeFetcher
int tmpdir_dfd;
bool force_anonymous;
char *custom_user_agent;
long opt_low_speed_limit;
long opt_low_speed_time;
guint32 opt_low_speed_limit;
guint32 opt_low_speed_time;
gboolean opt_retry_all;

GMainContext *mainctx;
Expand Down Expand Up @@ -186,9 +186,6 @@ _ostree_fetcher_finalize (GObject *object)
g_free (self->tls_client_key_path);
g_free (self->cookie_jar_path);
g_free (self->proxy);
g_free (self->opt_low_speed_limit);
g_free (self->opt_low_speed_time);
g_free (self->opt_retry_all);
g_assert_cmpint (g_hash_table_size (self->outstanding_requests), ==, 0);
g_clear_pointer (&self->extra_headers, curl_slist_free_all);
g_hash_table_unref (self->outstanding_requests);
Expand Down Expand Up @@ -675,6 +672,24 @@ _ostree_fetcher_set_proxy (OstreeFetcher *self, const char *http_proxy)
self->proxy = g_strdup (http_proxy);
}

void
_ostree_fetcher_set_low_speed_time (OstreeFetcher *self, guint32 opt_low_speed_time)
{
self->opt_low_speed_time = opt_low_speed_time;
}

void
_ostree_fetcher_set_low_speed_limit (OstreeFetcher *self, guint32 opt_low_speed_limit)
{
self->opt_low_speed_limit = opt_low_speed_limit;
}

void
_ostree_fetcher_set_retry_all (OstreeFetcher *self, gboolean opt_retry_all)
{
self->opt_retry_all = opt_retry_all;
}

void
_ostree_fetcher_set_cookie_jar (OstreeFetcher *self, const char *jar_path)
{
Expand Down
6 changes: 3 additions & 3 deletions src/libostree/ostree-fetcher.h
Original file line number Diff line number Diff line change
Expand Up @@ -99,11 +99,11 @@ void _ostree_fetcher_set_proxy (OstreeFetcher *fetcher, const char *proxy);
void _ostree_fetcher_set_client_cert (OstreeFetcher *fetcher, const char *cert_path,
const char *key_path);

void _ostree_fetcher_set_low_speed_limit (OstreeFetcher *self, long *opt_low_speed_limit);
void _ostree_fetcher_set_low_speed_limit (OstreeFetcher *self, guint32 opt_low_speed_limit);

void _ostree_fetcher_set_low_speed_time (OstreeFetcher *self, long *opt_low_speed_time);
void _ostree_fetcher_set_low_speed_time (OstreeFetcher *self, guint32 opt_low_speed_time);

void _ostree_fetcher_set_retry_all (OstreeFetcher *self, gboolean *opt_retry_all;
void _ostree_fetcher_set_retry_all (OstreeFetcher *self, gboolean opt_retry_all);

void _ostree_fetcher_set_tls_database (OstreeFetcher *self, const char *tlsdb_path);

Expand Down
4 changes: 2 additions & 2 deletions src/libostree/ostree-repo-pull-private.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ typedef struct

GVariant *extra_headers;
char *append_user_agent;
long low_speed_limit;
long low_speed_time;
guint32 low_speed_limit;
guint32 low_speed_time;
gboolean retry_all;


Expand Down
17 changes: 7 additions & 10 deletions src/libostree/ostree-repo-pull.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,9 @@
* _ostree_fetcher_should_retry_request(). This is the default value for the
* `n-network-retries` pull option. */
#define DEFAULT_N_NETWORK_RETRIES 5
#define OPT_LOWSPEEDLIMIT_DEFAULT 1000L
#define OPT_LOWSPEEDTIME_DEFAULT 30L
#define OPT_RETRYALL_DEFAULT true
#define OPT_LOWSPEEDLIMIT_DEFAULT 1000
#define OPT_LOWSPEEDTIME_DEFAULT 30
#define OPT_RETRYALL_DEFAULT TRUE

typedef struct
{
Expand Down Expand Up @@ -2931,7 +2931,7 @@ _ostree_repo_cache_summary (OstreeRepo *self, const char *remote, GBytes *summar
static OstreeFetcher *
_ostree_repo_remote_new_fetcher (OstreeRepo *self, const char *remote_name, gboolean gzip,
GVariant *extra_headers, const char *append_user_agent,
long low_speed_limit, long low_speed_time,
guint32 low_speed_limit, guint32 low_speed_time,
gboolean retry_all, OstreeFetcherSecurityState *out_state,
GError **error)
{
Expand Down Expand Up @@ -4914,9 +4914,6 @@ ostree_repo_pull_with_options (OstreeRepo *self, const char *remote_name_or_base
g_free (pull_data->remote_refspec_name);
g_free (pull_data->remote_name);
g_free (pull_data->append_user_agent);
g_free (pull_data->low_speed_limit);
g_free (pull_data->low_speed_time);
g_free (pull_data->retry_all);
g_clear_pointer (&pull_data->signapi_commit_verifiers, g_ptr_array_unref);
g_clear_pointer (&pull_data->signapi_summary_verifiers, g_ptr_array_unref);
g_clear_pointer (&pull_data->meta_mirrorlist, g_ptr_array_unref);
Expand Down Expand Up @@ -5715,7 +5712,7 @@ find_remotes_cb (GObject *obj, GAsyncResult *async_result, gpointer user_data)
goto error;

fetcher = _ostree_repo_remote_new_fetcher (self, result->remote->name, TRUE, NULL,
NULL, NULL, NULL, TRUE, NULL, &error);
NULL, 0, 0, TRUE, NULL, &error);
if (fetcher == NULL)
goto error;

Expand Down Expand Up @@ -6329,8 +6326,8 @@ ostree_repo_remote_fetch_summary_with_options (OstreeRepo *self, const char *nam
g_autoptr (GVariant) extra_headers = NULL;
g_autoptr (GPtrArray) mirrorlist = NULL;
const char *append_user_agent = NULL;
long low_speed_limit = OPT_LOWSPEEDLIMIT_DEFAULT;
long low_speed_time = OPT_LOWSPEEDTIME_DEFAULT;
guint32 low_speed_limit = OPT_LOWSPEEDLIMIT_DEFAULT;
guint32 low_speed_time = OPT_LOWSPEEDTIME_DEFAULT;
gboolean retry_all = OPT_RETRYALL_DEFAULT;
guint n_network_retries = DEFAULT_N_NETWORK_RETRIES;
gboolean summary_sig_not_modified = FALSE;
Expand Down

0 comments on commit f1cfa47

Please sign in to comment.