Skip to content

Commit

Permalink
fixup! WIP: libcurl backend
Browse files Browse the repository at this point in the history
  • Loading branch information
cgwalters committed Jan 19, 2017
1 parent bda80cd commit dbc0b7e
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/libostree/ostree-fetcher-curl.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ struct OstreeFetcher
char *tls_client_cert_path;
char *tls_client_key_path;
char *cookie_jar_path;
char *proxy;
struct curl_slist *extra_headers;
int tmpdir_dfd;

Expand Down Expand Up @@ -148,6 +149,7 @@ _ostree_fetcher_finalize (GObject *object)
OstreeFetcher *self = OSTREE_FETCHER (object);

g_free (self->cookie_jar_path);
g_free (self->proxy);
g_assert_cmpint (g_hash_table_size (self->outstanding_requests), ==, 0);
g_clear_pointer (&self->extra_headers, (GDestroyNotify)curl_slist_free_all);
g_hash_table_unref (self->outstanding_requests);
Expand Down Expand Up @@ -594,6 +596,8 @@ void
_ostree_fetcher_set_proxy (OstreeFetcher *self,
const char *http_proxy)
{
g_free (self->proxy);
self->proxy = g_strdup (http_proxy);
}

void
Expand Down Expand Up @@ -700,6 +704,12 @@ initiate_next_curl_request (FetcherRequest *req,
g_assert_cmpint (rc, ==, CURLM_OK);
}

if (self->proxy)
{
rc = curl_easy_setopt (req->easy, CURLOPT_PROXY, self->proxy);
g_assert_cmpint (rc, ==, CURLM_OK);
}

if (self->tls_ca_db_path)
curl_easy_setopt (req->easy, CURLOPT_CAINFO, self->tls_ca_db_path);

Expand Down

0 comments on commit dbc0b7e

Please sign in to comment.