From 5a0e94b8a75be2e59617af31326bd5defaab0ac5 Mon Sep 17 00:00:00 2001 From: Jonathan Matthew Date: Mon, 26 Jan 2009 09:51:36 +0100 Subject: Use libsoup-gnome for proxy configuration if available If libsoup-gnome is found use this as it will give us the GNOME proxy configuration. Otherwise use normal libsoup. The GNOME proxy configuration will only be used if the proxy properties are not set on souphttpsrc and if the http_proxy environment variable is not set. Fixes bug #552140. --- ext/soup/gstsouphttpsrc.c | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'ext/soup') diff --git a/ext/soup/gstsouphttpsrc.c b/ext/soup/gstsouphttpsrc.c index 139d3337..ad7433c1 100644 --- a/ext/soup/gstsouphttpsrc.c +++ b/ext/soup/gstsouphttpsrc.c @@ -25,6 +25,8 @@ * * An HTTP proxy must be specified by its URL. * If the "http_proxy" environment variable is set, its value is used. + * If built with libsoup's GNOME integration features, the GNOME proxy + * configuration will be used, or failing that, proxy autodetection. * The element-souphttpsrc::proxy property can be used to override the * default. * @@ -94,7 +96,11 @@ #endif #include #include +#ifdef HAVE_LIBSOUP_GNOME +#include +#else #include +#endif #include "gstsouphttpsrc.h" #include @@ -1127,15 +1133,21 @@ gst_soup_http_src_start (GstBaseSrc * bsrc) return FALSE; } - if (src->proxy == NULL) + if (src->proxy == NULL) { src->session = soup_session_async_new_with_options (SOUP_SESSION_ASYNC_CONTEXT, - src->context, SOUP_SESSION_USER_AGENT, src->user_agent, NULL); - else + src->context, SOUP_SESSION_USER_AGENT, src->user_agent, +#ifdef HAVE_LIBSOUP_GNOME + SOUP_SESSION_ADD_FEATURE, SOUP_TYPE_PROXY_RESOLVER_GNOME, +#endif + NULL); + } else { src->session = soup_session_async_new_with_options (SOUP_SESSION_ASYNC_CONTEXT, src->context, SOUP_SESSION_PROXY_URI, src->proxy, SOUP_SESSION_USER_AGENT, src->user_agent, NULL); + } + if (!src->session) { GST_ELEMENT_ERROR (src, LIBRARY, INIT, (NULL), ("Failed to create async session")); -- cgit