[geocode-glib] geocode-glib: Add another User-Agent fallback string



commit befbd2faacc40ad0bd0794c33872b0dd2e619797
Author: Philip Withnall <philip withnall collabora co uk>
Date:   Thu Oct 13 18:54:05 2016 +0100

    geocode-glib: Add another User-Agent fallback string
    
    If a GApplication is not available, see if the application name was set
    using g_set_application_name() — if so, use that in the User-Agent
    string to try and make it more unique.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=756313

 geocode-glib/geocode-glib.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
---
diff --git a/geocode-glib/geocode-glib.c b/geocode-glib/geocode-glib.c
index 2496484..1d92e34 100644
--- a/geocode-glib/geocode-glib.c
+++ b/geocode-glib/geocode-glib.c
@@ -51,6 +51,11 @@ _geocode_glib_build_soup_session (const gchar *user_agent_override)
                user_agent = g_strdup_printf ("geocode-glib/%s (%s)",
                                              PACKAGE_VERSION, id);
                user_agent_allocated = user_agent;
+       } else if (g_get_application_name () != NULL) {
+               user_agent = g_strdup_printf ("geocode-glib/%s (%s)",
+                                             PACKAGE_VERSION,
+                                             g_get_application_name ());
+               user_agent_allocated = user_agent;
        } else {
                user_agent = g_strdup_printf ("geocode-glib/%s",
                                              PACKAGE_VERSION);


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