diff options
author | Colin Walters <walters@verbum.org> | 2014-06-08 08:04:46 -0400 |
---|---|---|
committer | Colin Walters <walters@verbum.org> | 2014-06-09 14:04:53 -0400 |
commit | 24c64d6b4fea57040f4711ea0377e99482356915 (patch) | |
tree | 00c5206a8afdc8c77053ad9175a501c2b65fb7c8 /src/libostree | |
parent | 4ce93db595876e241537394884ab98f6665c2a49 (diff) | |
download | ostree-24c64d6b4fea57040f4711ea0377e99482356915.tar.gz |
libostree: Make OstreeFetcher explicitly private
Per previous commit. We're not attempting to export an HTTP to
clients, the high level API is ostree_repo_pull().
https://bugzilla.gnome.org/show_bug.cgi?id=731369
Diffstat (limited to 'src/libostree')
-rw-r--r-- | src/libostree/ostree-fetcher.c | 38 | ||||
-rw-r--r-- | src/libostree/ostree-fetcher.h | 22 | ||||
-rw-r--r-- | src/libostree/ostree-repo-pull.c | 18 |
3 files changed, 39 insertions, 39 deletions
diff --git a/src/libostree/ostree-fetcher.c b/src/libostree/ostree-fetcher.c index 24df14b6..6172a91f 100644 --- a/src/libostree/ostree-fetcher.c +++ b/src/libostree/ostree-fetcher.c @@ -103,10 +103,10 @@ struct OstreeFetcher gint max_outstanding; }; -G_DEFINE_TYPE (OstreeFetcher, ostree_fetcher, G_TYPE_OBJECT) +G_DEFINE_TYPE (OstreeFetcher, _ostree_fetcher, G_TYPE_OBJECT) static void -ostree_fetcher_finalize (GObject *object) +_ostree_fetcher_finalize (GObject *object) { OstreeFetcher *self; @@ -122,15 +122,15 @@ ostree_fetcher_finalize (GObject *object) g_queue_clear (&self->pending_queue); - G_OBJECT_CLASS (ostree_fetcher_parent_class)->finalize (object); + G_OBJECT_CLASS (_ostree_fetcher_parent_class)->finalize (object); } static void -ostree_fetcher_class_init (OstreeFetcherClass *klass) +_ostree_fetcher_class_init (OstreeFetcherClass *klass) { GObjectClass *gobject_class = G_OBJECT_CLASS (klass); - gobject_class->finalize = ostree_fetcher_finalize; + gobject_class->finalize = _ostree_fetcher_finalize; } static void @@ -154,7 +154,7 @@ on_request_unqueued (SoupSession *session, } static void -ostree_fetcher_init (OstreeFetcher *self) +_ostree_fetcher_init (OstreeFetcher *self) { gint max_conns; const char *http_proxy; @@ -203,7 +203,7 @@ ostree_fetcher_init (OstreeFetcher *self) } OstreeFetcher * -ostree_fetcher_new (GFile *tmpdir, +_ostree_fetcher_new (GFile *tmpdir, OstreeFetcherConfigFlags flags) { OstreeFetcher *self = (OstreeFetcher*)g_object_new (OSTREE_TYPE_FETCHER, NULL); @@ -216,7 +216,7 @@ ostree_fetcher_new (GFile *tmpdir, } void -ostree_fetcher_set_client_cert (OstreeFetcher *fetcher, +_ostree_fetcher_set_client_cert (OstreeFetcher *fetcher, GTlsCertificate *cert) { g_clear_object (&fetcher->client_cert); @@ -528,7 +528,7 @@ ostree_fetcher_request_uri_internal (OstreeFetcher *self, } void -ostree_fetcher_request_uri_with_partial_async (OstreeFetcher *self, +_ostree_fetcher_request_uri_with_partial_async (OstreeFetcher *self, SoupURI *uri, guint64 max_size, GCancellable *cancellable, @@ -543,7 +543,7 @@ ostree_fetcher_request_uri_with_partial_async (OstreeFetcher *self, pending = ostree_fetcher_request_uri_internal (self, uri, FALSE, max_size, cancellable, callback, user_data, - ostree_fetcher_request_uri_with_partial_async); + _ostree_fetcher_request_uri_with_partial_async); if (!ot_gfile_query_info_allow_noent (pending->out_tmpfile, OSTREE_GIO_FAST_QUERYINFO, G_FILE_QUERY_INFO_NOFOLLOW_SYMLINKS, @@ -574,14 +574,14 @@ ostree_fetcher_request_uri_with_partial_async (OstreeFetcher *self, } GFile * -ostree_fetcher_request_uri_with_partial_finish (OstreeFetcher *self, +_ostree_fetcher_request_uri_with_partial_finish (OstreeFetcher *self, GAsyncResult *result, GError **error) { GSimpleAsyncResult *simple; OstreeFetcherPendingURI *pending; - g_return_val_if_fail (g_simple_async_result_is_valid (result, (GObject*)self, ostree_fetcher_request_uri_with_partial_async), FALSE); + g_return_val_if_fail (g_simple_async_result_is_valid (result, (GObject*)self, _ostree_fetcher_request_uri_with_partial_async), FALSE); simple = G_SIMPLE_ASYNC_RESULT (result); if (g_simple_async_result_propagate_error (simple, error)) @@ -592,7 +592,7 @@ ostree_fetcher_request_uri_with_partial_finish (OstreeFetcher *self, } void -ostree_fetcher_stream_uri_async (OstreeFetcher *self, +_ostree_fetcher_stream_uri_async (OstreeFetcher *self, SoupURI *uri, guint64 max_size, GCancellable *cancellable, @@ -605,7 +605,7 @@ ostree_fetcher_stream_uri_async (OstreeFetcher *self, pending = ostree_fetcher_request_uri_internal (self, uri, TRUE, max_size, cancellable, callback, user_data, - ostree_fetcher_stream_uri_async); + _ostree_fetcher_stream_uri_async); if (SOUP_IS_REQUEST_HTTP (pending->request)) { @@ -619,14 +619,14 @@ ostree_fetcher_stream_uri_async (OstreeFetcher *self, } GInputStream * -ostree_fetcher_stream_uri_finish (OstreeFetcher *self, +_ostree_fetcher_stream_uri_finish (OstreeFetcher *self, GAsyncResult *result, GError **error) { GSimpleAsyncResult *simple; OstreeFetcherPendingURI *pending; - g_return_val_if_fail (g_simple_async_result_is_valid (result, (GObject*)self, ostree_fetcher_stream_uri_async), FALSE); + g_return_val_if_fail (g_simple_async_result_is_valid (result, (GObject*)self, _ostree_fetcher_stream_uri_async), FALSE); simple = G_SIMPLE_ASYNC_RESULT (result); if (g_simple_async_result_propagate_error (simple, error)) @@ -650,7 +650,7 @@ format_size_pair (guint64 start, } char * -ostree_fetcher_query_state_text (OstreeFetcher *self) +_ostree_fetcher_query_state_text (OstreeFetcher *self) { guint n_active; @@ -700,7 +700,7 @@ ostree_fetcher_query_state_text (OstreeFetcher *self) } guint64 -ostree_fetcher_bytes_transferred (OstreeFetcher *self) +_ostree_fetcher_bytes_transferred (OstreeFetcher *self) { guint64 ret = self->total_downloaded; GHashTableIter hiter; @@ -723,7 +723,7 @@ ostree_fetcher_bytes_transferred (OstreeFetcher *self) } guint -ostree_fetcher_get_n_requests (OstreeFetcher *self) +_ostree_fetcher_get_n_requests (OstreeFetcher *self) { return self->total_requests; } diff --git a/src/libostree/ostree-fetcher.h b/src/libostree/ostree-fetcher.h index 55b5e1d2..0288392f 100644 --- a/src/libostree/ostree-fetcher.h +++ b/src/libostree/ostree-fetcher.h @@ -29,7 +29,7 @@ G_BEGIN_DECLS -#define OSTREE_TYPE_FETCHER (ostree_fetcher_get_type ()) +#define OSTREE_TYPE_FETCHER (_ostree_fetcher_get_type ()) #define OSTREE_FETCHER(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), OSTREE_TYPE_FETCHER, OstreeFetcher)) #define OSTREE_FETCHER_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), OSTREE_TYPE_FETCHER, OstreeFetcherClass)) #define OSTREE_IS_FETCHER(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), OSTREE_TYPE_FETCHER)) @@ -49,39 +49,39 @@ typedef enum { OSTREE_FETCHER_FLAGS_TLS_PERMISSIVE = (1 << 0) } OstreeFetcherConfigFlags; -GType ostree_fetcher_get_type (void) G_GNUC_CONST; +GType _ostree_fetcher_get_type (void) G_GNUC_CONST; -OstreeFetcher *ostree_fetcher_new (GFile *tmpdir, +OstreeFetcher *_ostree_fetcher_new (GFile *tmpdir, OstreeFetcherConfigFlags flags); -void ostree_fetcher_set_client_cert (OstreeFetcher *fetcher, +void _ostree_fetcher_set_client_cert (OstreeFetcher *fetcher, GTlsCertificate *cert); -char * ostree_fetcher_query_state_text (OstreeFetcher *self); +char * _ostree_fetcher_query_state_text (OstreeFetcher *self); -guint64 ostree_fetcher_bytes_transferred (OstreeFetcher *self); +guint64 _ostree_fetcher_bytes_transferred (OstreeFetcher *self); -guint ostree_fetcher_get_n_requests (OstreeFetcher *self); +guint _ostree_fetcher_get_n_requests (OstreeFetcher *self); -void ostree_fetcher_request_uri_with_partial_async (OstreeFetcher *self, +void _ostree_fetcher_request_uri_with_partial_async (OstreeFetcher *self, SoupURI *uri, guint64 max_size, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data); -GFile *ostree_fetcher_request_uri_with_partial_finish (OstreeFetcher *self, +GFile *_ostree_fetcher_request_uri_with_partial_finish (OstreeFetcher *self, GAsyncResult *result, GError **error); -void ostree_fetcher_stream_uri_async (OstreeFetcher *self, +void _ostree_fetcher_stream_uri_async (OstreeFetcher *self, SoupURI *uri, guint64 max_size, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data); -GInputStream *ostree_fetcher_stream_uri_finish (OstreeFetcher *self, +GInputStream *_ostree_fetcher_stream_uri_finish (OstreeFetcher *self, GAsyncResult *result, GError **error); diff --git a/src/libostree/ostree-repo-pull.c b/src/libostree/ostree-repo-pull.c index 9097d011..467d27e9 100644 --- a/src/libostree/ostree-repo-pull.c +++ b/src/libostree/ostree-repo-pull.c @@ -139,7 +139,7 @@ update_progress (gpointer user_data) pull_data->n_outstanding_metadata_write_requests; guint outstanding_fetches = pull_data->n_outstanding_content_fetches + pull_data->n_outstanding_metadata_fetches; - guint64 bytes_transferred = ostree_fetcher_bytes_transferred (pull_data->fetcher); + guint64 bytes_transferred = _ostree_fetcher_bytes_transferred (pull_data->fetcher); guint fetched = pull_data->n_fetched_metadata + pull_data->n_fetched_content; guint requested = pull_data->n_requested_metadata + pull_data->n_requested_content; guint n_scanned_metadata = pull_data->n_scanned_metadata; @@ -258,7 +258,7 @@ fetch_uri_sync_on_complete (GObject *object, { OstreeFetchUriSyncData *data = user_data; - data->result_stream = ostree_fetcher_stream_uri_finish ((OstreeFetcher*)object, + data->result_stream = _ostree_fetcher_stream_uri_finish ((OstreeFetcher*)object, result, data->pull_data->async_error); data->pull_data->fetching_sync_uri = NULL; g_main_loop_quit (data->pull_data->loop); @@ -287,7 +287,7 @@ fetch_uri_contents_membuf_sync (OtPullData *pull_data, fetch_data.pull_data = pull_data; pull_data->fetching_sync_uri = uri; - ostree_fetcher_stream_uri_async (pull_data->fetcher, uri, + _ostree_fetcher_stream_uri_async (pull_data->fetcher, uri, OSTREE_MAX_METADATA_SIZE, cancellable, fetch_uri_sync_on_complete, &fetch_data); @@ -540,7 +540,7 @@ content_fetch_on_complete (GObject *object, const char *checksum; OstreeObjectType objtype; - temp_path = ostree_fetcher_request_uri_with_partial_finish ((OstreeFetcher*)object, result, error); + temp_path = _ostree_fetcher_request_uri_with_partial_finish ((OstreeFetcher*)object, result, error); if (!temp_path) goto out; @@ -644,7 +644,7 @@ meta_fetch_on_complete (GObject *object, ostree_object_name_deserialize (fetch_data->object, &checksum, &objtype); g_debug ("fetch of %s complete", ostree_object_to_string (checksum, objtype)); - temp_path = ostree_fetcher_request_uri_with_partial_finish ((OstreeFetcher*)object, result, error); + temp_path = _ostree_fetcher_request_uri_with_partial_finish ((OstreeFetcher*)object, result, error); if (!temp_path) { if (!g_error_matches (local_error, G_IO_ERROR, G_IO_ERROR_NOT_FOUND)) @@ -885,7 +885,7 @@ enqueue_one_object_request (OtPullData *pull_data, fetch_data->pull_data = pull_data; fetch_data->object = ostree_object_name_serialize (checksum, objtype); fetch_data->is_detached_meta = is_detached_meta; - ostree_fetcher_request_uri_with_partial_async (pull_data->fetcher, obj_uri, + _ostree_fetcher_request_uri_with_partial_async (pull_data->fetcher, obj_uri, is_meta ? OSTREE_MAX_METADATA_SIZE : 0, pull_data->cancellable, is_meta ? meta_fetch_on_complete : content_fetch_on_complete, fetch_data); @@ -1087,7 +1087,7 @@ ostree_repo_pull (OstreeRepo *self, if (tls_permissive) fetcher_flags |= OSTREE_FETCHER_FLAGS_TLS_PERMISSIVE; - pull_data->fetcher = ostree_fetcher_new (pull_data->repo->tmp_dir, + pull_data->fetcher = _ostree_fetcher_new (pull_data->repo->tmp_dir, fetcher_flags); { @@ -1121,7 +1121,7 @@ ostree_repo_pull (OstreeRepo *self, if (!client_cert) goto out; - ostree_fetcher_set_client_cert (pull_data->fetcher, client_cert); + _ostree_fetcher_set_client_cert (pull_data->fetcher, client_cert); } } @@ -1272,7 +1272,7 @@ ostree_repo_pull (OstreeRepo *self, end_time = g_get_monotonic_time (); - bytes_transferred = ostree_fetcher_bytes_transferred (pull_data->fetcher); + bytes_transferred = _ostree_fetcher_bytes_transferred (pull_data->fetcher); if (bytes_transferred > 0 && pull_data->progress) { guint shift; |