summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Hughes <richard@hughsie.com>2015-08-11 20:02:03 +0100
committerRichard Hughes <richard@hughsie.com>2015-08-11 20:02:03 +0100
commit26b7ca924b1cb196e10ac1780e2d2ab736db85bf (patch)
treee979819c74dd6c5c57572a39e4d703f3f5ab841b
parent8cbc6748df0b93baa108d2a8831067c1bc86c80e (diff)
downloadappstream-glib-26b7ca924b1cb196e10ac1780e2d2ab736db85bf.tar.gz
Remove an unused exported method
-rw-r--r--libappstream-glib/as-self-test.c15
-rw-r--r--libappstream-glib/as-utils.c70
-rw-r--r--libappstream-glib/as-utils.h3
3 files changed, 0 insertions, 88 deletions
diff --git a/libappstream-glib/as-self-test.c b/libappstream-glib/as-self-test.c
index 594ffb9..c014cc2 100644
--- a/libappstream-glib/as-self-test.c
+++ b/libappstream-glib/as-self-test.c
@@ -3491,21 +3491,6 @@ as_test_utils_func (void)
g_assert_cmpstr (tmp, ==, NULL);
g_clear_error (&error);
- /* invalid URLs */
- ret = as_utils_check_url_exists ("hello dave", 1, &error);
- g_assert (!ret);
- g_assert (error != NULL);
- g_clear_error (&error);
- ret = as_utils_check_url_exists ("http://www.bbc.co.uk/notgoingtoexist", 1, &error);
- g_assert (!ret);
- g_assert (error != NULL);
- g_clear_error (&error);
-
- /* valid URLs */
- //ret = as_utils_check_url_exists ("http://www.bbc.co.uk/", &error);
- //g_assert (ret);
- //g_assert_no_error (error);
-
/* valid tokens */
g_assert (as_utils_search_token_valid ("battery"));
g_assert (!as_utils_search_token_valid ("and"));
diff --git a/libappstream-glib/as-utils.c b/libappstream-glib/as-utils.c
index 4b31e50..a3d9299 100644
--- a/libappstream-glib/as-utils.c
+++ b/libappstream-glib/as-utils.c
@@ -34,7 +34,6 @@
#include <fnmatch.h>
#include <string.h>
-#include <libsoup/soup.h>
#include <archive_entry.h>
#include <archive.h>
#include <stdlib.h>
@@ -650,75 +649,6 @@ as_utils_is_spdx_license (const gchar *license)
}
/**
- * as_utils_check_url_exists:
- * @url: the URL to check.
- * @timeout: the timeout in seconds.
- * @error: A #GError or %NULL
- *
- * Checks to see if a URL is reachable.
- *
- * Returns: %TRUE if the URL was reachable and pointed to a non-zero-length file.
- *
- * Since: 0.1.5
- **/
-gboolean
-as_utils_check_url_exists (const gchar *url, guint timeout, GError **error)
-{
- _cleanup_object_unref_ SoupMessage *msg = NULL;
- _cleanup_object_unref_ SoupSession *session = NULL;
- _cleanup_uri_unref_ SoupURI *base_uri = NULL;
-
- /* GET file */
- base_uri = soup_uri_new (url);
- if (base_uri == NULL) {
- g_set_error_literal (error,
- AS_NODE_ERROR,
- AS_NODE_ERROR_FAILED,
- "URL not valid");
- return FALSE;
- }
- msg = soup_message_new_from_uri (SOUP_METHOD_GET, base_uri);
- if (msg == NULL) {
- g_set_error_literal (error,
- AS_NODE_ERROR,
- AS_NODE_ERROR_FAILED,
- "Failed to setup message");
- return FALSE;
- }
- session = soup_session_sync_new_with_options (SOUP_SESSION_USER_AGENT,
- "libappstream-glib",
- SOUP_SESSION_TIMEOUT,
- timeout,
- NULL);
- if (session == NULL) {
- g_set_error_literal (error,
- AS_NODE_ERROR,
- AS_NODE_ERROR_FAILED,
- "Failed to set up networking");
- return FALSE;
- }
-
- /* send sync */
- if (soup_session_send_message (session, msg) != SOUP_STATUS_OK) {
- g_set_error_literal (error,
- AS_NODE_ERROR,
- AS_NODE_ERROR_FAILED,
- msg->reason_phrase);
- return FALSE;
- }
-
- /* check if it's a zero sized file */
- if (msg->response_body->length == 0) {
- g_set_error (error,
- AS_NODE_ERROR,
- AS_NODE_ERROR_FAILED,
- "Returned a zero length file");
- return FALSE;
- }
- return TRUE;
-}
-
-/**
* as_pixbuf_blur_private:
**/
static void
diff --git a/libappstream-glib/as-utils.h b/libappstream-glib/as-utils.h
index 26c819b..aa0baf4 100644
--- a/libappstream-glib/as-utils.h
+++ b/libappstream-glib/as-utils.h
@@ -107,9 +107,6 @@ gboolean as_utils_is_category_id (const gchar *category_id);
gboolean as_utils_is_blacklisted_id (const gchar *desktop_id);
gchar **as_utils_spdx_license_tokenize (const gchar *license);
gchar *as_utils_spdx_license_detokenize (gchar **license_tokens);
-gboolean as_utils_check_url_exists (const gchar *url,
- guint timeout,
- GError **error);
gchar *as_utils_find_icon_filename (const gchar *destdir,
const gchar *search,
GError **error);