mirror of
https://github.com/ostreedev/ostree.git
synced 2025-03-19 22:50:35 +03:00
ostree-fetcher: remove two unused functions
_ostree_fetcher_query_state_text() and_ostree_fetcher_get_n_requests() have no callers, so remove them. If they will be needed, they can be easily copied back from the git history. Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
This commit is contained in:
parent
c832e9b751
commit
a4a4921d3f
@ -664,69 +664,6 @@ _ostree_fetcher_stream_uri_finish (OstreeFetcher *self,
|
||||
return g_object_ref (pending->request_body);
|
||||
}
|
||||
|
||||
static char *
|
||||
format_size_pair (guint64 start,
|
||||
guint64 max)
|
||||
{
|
||||
if (max < 1024)
|
||||
return g_strdup_printf ("%lu/%lu bytes",
|
||||
(gulong) start,
|
||||
(gulong) max);
|
||||
else
|
||||
return g_strdup_printf ("%.1f/%.1f KiB", ((double) start) / 1024,
|
||||
((double) max) / 1024);
|
||||
}
|
||||
|
||||
char *
|
||||
_ostree_fetcher_query_state_text (OstreeFetcher *self)
|
||||
{
|
||||
guint n_active;
|
||||
|
||||
n_active = g_hash_table_size (self->sending_messages);
|
||||
if (n_active > 0)
|
||||
{
|
||||
GHashTableIter hash_iter;
|
||||
gpointer key, value;
|
||||
GString *buf;
|
||||
|
||||
buf = g_string_new ("");
|
||||
|
||||
g_string_append_printf (buf, "%u requests", n_active);
|
||||
|
||||
g_hash_table_iter_init (&hash_iter, self->sending_messages);
|
||||
while (g_hash_table_iter_next (&hash_iter, &key, &value))
|
||||
{
|
||||
OstreeFetcherPendingURI *active;
|
||||
|
||||
active = g_hash_table_lookup (self->message_to_request, key);
|
||||
g_assert (active != NULL);
|
||||
|
||||
if (active->out_tmpfile)
|
||||
{
|
||||
gs_unref_object GFileInfo *file_info = NULL;
|
||||
|
||||
file_info = g_file_query_info (active->out_tmpfile, OSTREE_GIO_FAST_QUERYINFO,
|
||||
G_FILE_QUERY_INFO_NOFOLLOW_SYMLINKS,
|
||||
NULL, NULL);
|
||||
if (file_info)
|
||||
{
|
||||
gs_free char *size = format_size_pair (g_file_info_get_size (file_info),
|
||||
active->content_length);
|
||||
g_string_append_printf (buf, " [%s]", size);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
g_string_append_printf (buf, " [Requesting]");
|
||||
}
|
||||
}
|
||||
|
||||
return g_string_free (buf, FALSE);
|
||||
}
|
||||
else
|
||||
return g_strdup_printf ("Idle");
|
||||
}
|
||||
|
||||
guint64
|
||||
_ostree_fetcher_bytes_transferred (OstreeFetcher *self)
|
||||
{
|
||||
@ -750,13 +687,6 @@ _ostree_fetcher_bytes_transferred (OstreeFetcher *self)
|
||||
return ret;
|
||||
}
|
||||
|
||||
guint
|
||||
_ostree_fetcher_get_n_requests (OstreeFetcher *self)
|
||||
{
|
||||
return self->total_requests;
|
||||
}
|
||||
|
||||
|
||||
typedef struct
|
||||
{
|
||||
GInputStream *result_stream;
|
||||
|
@ -63,12 +63,8 @@ void _ostree_fetcher_set_client_cert (OstreeFetcher *fetcher,
|
||||
void _ostree_fetcher_set_tls_database (OstreeFetcher *self,
|
||||
GTlsDatabase *db);
|
||||
|
||||
char * _ostree_fetcher_query_state_text (OstreeFetcher *self);
|
||||
|
||||
guint64 _ostree_fetcher_bytes_transferred (OstreeFetcher *self);
|
||||
|
||||
guint _ostree_fetcher_get_n_requests (OstreeFetcher *self);
|
||||
|
||||
void _ostree_fetcher_request_uri_with_partial_async (OstreeFetcher *self,
|
||||
SoupURI *uri,
|
||||
guint64 max_size,
|
||||
|
Loading…
x
Reference in New Issue
Block a user