[telepathy-gabble/master] fd.o#21151: Don't query SOCKS5 proxies when we are connected

Guillaume Desmottes guillaume.desmottes at collabora.co.uk
Thu Nov 26 05:50:23 PST 2009


We should query the SOCKS5 proxies only when we'll actually need them.
Export the query method so other components will be able to start the querying
process when needed.
---
 src/bytestream-factory.c |   11 ++++-------
 src/bytestream-factory.h |    3 +++
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/src/bytestream-factory.c b/src/bytestream-factory.c
index 4336aa4..728d2a4 100644
--- a/src/bytestream-factory.c
+++ b/src/bytestream-factory.c
@@ -297,8 +297,6 @@ disco_item_found_cb (GabbleDisco *disco,
   send_proxy_query (self, item->jid, FALSE);
 }
 
-static void query_socks5_proxies (GabbleBytestreamFactory *self);
-
 static gboolean
 socks5_proxies_timeout_cb (gpointer data)
 {
@@ -316,13 +314,14 @@ socks5_proxies_timeout_cb (gpointer data)
       return FALSE;
     }
 
-  query_socks5_proxies (self);
+  gabble_bytestream_factory_query_socks5_proxies (self);
 
   return FALSE;
 }
 
-static void
-query_socks5_proxies (GabbleBytestreamFactory *self)
+/* ask to the factory to try to find more proxies if needed */
+void
+gabble_bytestream_factory_query_socks5_proxies (GabbleBytestreamFactory *self)
 {
   GabbleBytestreamFactoryPrivate *priv = GABBLE_BYTESTREAM_FACTORY_GET_PRIVATE (
       self);
@@ -422,8 +421,6 @@ conn_status_changed_cb (GabbleConnection *conn,
       priv->socks5_potential_proxies = randomize_g_slist (
               priv->socks5_potential_proxies);
 
-      query_socks5_proxies (self);
-
       g_strfreev (jids);
     }
 }
diff --git a/src/bytestream-factory.h b/src/bytestream-factory.h
index dcc58fc..ff5523d 100644
--- a/src/bytestream-factory.h
+++ b/src/bytestream-factory.h
@@ -109,6 +109,9 @@ gchar *gabble_bytestream_factory_generate_stream_id (void);
 GSList *gabble_bytestream_factory_get_socks5_proxies (
     GabbleBytestreamFactory *self);
 
+void gabble_bytestream_factory_query_socks5_proxies (
+    GabbleBytestreamFactory *self);
+
 G_END_DECLS
 
 #endif /* #ifndef __BYTESTREAM_FACTORY_H__ */
-- 
1.5.6.5




More information about the telepathy-commits mailing list