From 6f2fef07079fb083d76b9584da0c8e49214b214f Mon Sep 17 00:00:00 2001 From: Elliott Sales de Andrade Date: Thu, 10 Oct 2019 04:44:31 -0400 Subject: [PATCH] Remove Facebook HTTP connection pool code. It's unused with everything in libsoup sessions. --- libpurple/protocols/facebook/http.c | 74 ---------------------------------- libpurple/protocols/facebook/http.h | 79 ------------------------------------- 2 files changed, 153 deletions(-) diff --git a/libpurple/protocols/facebook/http.c b/libpurple/protocols/facebook/http.c index 62d9f050f4..a37bcd3576 100644 --- a/libpurple/protocols/facebook/http.c +++ b/libpurple/protocols/facebook/http.c @@ -25,12 +25,6 @@ #include "http.h" -struct _FbHttpConns -{ - GHashTable *cons; - gboolean canceled; -}; - GQuark fb_http_error_quark(void) { @@ -43,74 +37,6 @@ fb_http_error_quark(void) return q; } -FbHttpConns * -fb_http_conns_new(void) -{ - FbHttpConns *cons; - - cons = g_new0(FbHttpConns, 1); - cons->cons = g_hash_table_new(g_direct_hash, g_direct_equal); - return cons; -} - -void -fb_http_conns_free(FbHttpConns *cons) -{ - g_return_if_fail(cons != NULL); - - g_hash_table_destroy(cons->cons); - g_free(cons); -} - -void -fb_http_conns_cancel_all(FbHttpConns *cons) -{ - GHashTableIter iter; - gpointer con; - - g_return_if_fail(cons != NULL); - g_return_if_fail(!cons->canceled); - - cons->canceled = TRUE; - g_hash_table_iter_init(&iter, cons->cons); - - while (g_hash_table_iter_next(&iter, &con, NULL)) { - g_hash_table_iter_remove(&iter); - purple_http_conn_cancel(con); - } -} - -gboolean -fb_http_conns_is_canceled(FbHttpConns *cons) -{ - g_return_val_if_fail(cons != NULL, TRUE); - return cons->canceled; -} - -void -fb_http_conns_add(FbHttpConns *cons, PurpleHttpConnection *con) -{ - g_return_if_fail(cons != NULL); - g_return_if_fail(!cons->canceled); - g_hash_table_replace(cons->cons, con, con); -} - -void -fb_http_conns_remove(FbHttpConns *cons, PurpleHttpConnection *con) -{ - g_return_if_fail(cons != NULL); - g_return_if_fail(!cons->canceled); - g_hash_table_remove(cons->cons, con); -} - -void -fb_http_conns_reset(FbHttpConns *cons) -{ - g_return_if_fail(cons != NULL); - cons->canceled = FALSE; - g_hash_table_remove_all(cons->cons); -} - gboolean fb_http_error_chk(SoupMessage *res, GError **error) { diff --git a/libpurple/protocols/facebook/http.h b/libpurple/protocols/facebook/http.h index 8f5e71cf6b..cf0c47ff8f 100644 --- a/libpurple/protocols/facebook/http.h +++ b/libpurple/protocols/facebook/http.h @@ -44,13 +44,6 @@ #define FB_HTTP_ERROR fb_http_error_quark() /** - * FbHttpConns: - * - * Represents a set of #PurpleHttpConnection. - */ -typedef struct _FbHttpConns FbHttpConns; - -/** * FbHttpParams: * * Represents a set of key/value HTTP parameters. @@ -81,78 +74,6 @@ GQuark fb_http_error_quark(void); /** - * fb_http_conns_new: - * - * Creates a new #FbHttpConns. The returned #FbHttpConns should be - * freed with #fb_http_conns_free() when no longer needed. - * - * Returns: The new #FbHttpConns. - */ -FbHttpConns * -fb_http_conns_new(void); - -/** - * fb_http_conns_free: - * @cons: The #FbHttpConns. - * - * Frees all memory used by the #FbHttpConns. This will *not* cancel - * the any of the added #PurpleHttpConnection. - */ -void -fb_http_conns_free(FbHttpConns *cons); - -/** - * fb_http_conns_cancel_all: - * @cons: The #FbHttpConns. - * - * Cancels each #PurpleHttpConnection in the #FbHttpConns. - */ -void -fb_http_conns_cancel_all(FbHttpConns *cons); - -/** - * fb_http_conns_is_canceled: - * @cons: The #FbHttpConns. - * - * Determines if the #FbHttpConns has been canceled. - * - * Returns: #TRUE if it has been canceled, otherwise #FALSE. - */ -gboolean -fb_http_conns_is_canceled(FbHttpConns *cons); - -/** - * fb_http_conns_add: - * @cons: The #FbHttpConns. - * @con: The #PurpleHttpConnection. - * - * Adds a #PurpleHttpConnection to the #FbHttpConns. - */ -void -fb_http_conns_add(FbHttpConns *cons, PurpleHttpConnection *con); - -/** - * fb_http_conns_remove: - * @cons: The #FbHttpConns. - * @con: The #PurpleHttpConnection. - * - * Removes a #PurpleHttpConnection from the #FbHttpConns. - */ -void -fb_http_conns_remove(FbHttpConns *cons, PurpleHttpConnection *con); - -/** - * fb_http_conns_reset: - * @cons: The #FbHttpConns. - * - * Resets the #FbHttpConns. This removes each #PurpleHttpConnection - * from the #FbHttpConns *without* canceling it. This allows the the - * #FbHttpConns to be reused. - */ -void -fb_http_conns_reset(FbHttpConns *cons); - -/** * fb_http_error_chk: * @res: The #SoupMessage. * @error: The return location for the #GError or #NULL. -- 2.11.4.GIT