[libchamplain] Fix Bug 584149: libchamplain should set the user agent on libsoup



commit c9ad2026772de5d35eeefc67a6a8eed8ce8fa72d
Author: Pierre-Luc Beaudoin <pierre-luc pierlux com>
Date:   Thu Jun 11 23:46:39 2009 -0400

    Fix Bug 584149: libchamplain should set the user agent on libsoup

 champlain/champlain-network-map-source.c |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)
---
diff --git a/champlain/champlain-network-map-source.c b/champlain/champlain-network-map-source.c
index 9591cd9..1d018a6 100644
--- a/champlain/champlain-network-map-source.c
+++ b/champlain/champlain-network-map-source.c
@@ -599,12 +599,16 @@ fill_tile (ChamplainMapSource *map_source,
       g_object_ref (tile);
 
       if (!soup_session)
-        soup_session = soup_session_async_new_with_options ("proxy-uri",
-            soup_uri_new (priv->proxy_uri),
+        {
+          soup_session = soup_session_async_new_with_options ("proxy-uri",
+                soup_uri_new (priv->proxy_uri),
 #ifdef HAVE_LIBSOUP_GNOME
-            SOUP_SESSION_ADD_FEATURE_BY_TYPE, SOUP_TYPE_PROXY_RESOLVER_GNOME,
+              SOUP_SESSION_ADD_FEATURE_BY_TYPE, SOUP_TYPE_PROXY_RESOLVER_GNOME,
 #endif
-            NULL);
+              NULL);
+          g_object_set (G_OBJECT (soup_session), "user-agent", "libchamplain/"
+              CHAMPLAIN_VERSION_S, NULL);
+        }
 
       uri = champlain_network_map_source_get_tile_uri (source,
                champlain_tile_get_x (tile), champlain_tile_get_y (tile),



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]