* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General
- * Public License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place, Suite 330,
- * Boston, MA 02111-1307, USA.
+ * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
*
* Author: Nicolas Dufresne <nicolas.dufresne@collabora.co.uk>
*/
* @include: gio/gio.h
*
* #GProxyResolver provides synchronous and asynchronous network proxy
- * resolution. #GProxyResolver is used within #GClientSocket through
+ * resolution. #GProxyResolver is used within #GSocketClient through
* the method g_socket_connectable_proxy_enumerate().
*/
{
}
-static gpointer
-get_default_proxy_resolver (gpointer arg)
-{
- const gchar *use_this;
- GProxyResolver *resolver;
- GList *l;
- GIOExtensionPoint *ep;
- GIOExtension *extension;
-
-
- use_this = g_getenv ("GIO_USE_PROXY_RESOLVER");
-
- /* Ensure proxy-resolver modules loaded */
- _g_io_modules_ensure_loaded ();
-
- ep = g_io_extension_point_lookup (G_PROXY_RESOLVER_EXTENSION_POINT_NAME);
-
- if (use_this)
- {
- extension = g_io_extension_point_get_extension_by_name (ep, use_this);
- if (extension)
- {
- resolver = g_object_new (g_io_extension_get_type (extension), NULL);
-
- if (g_proxy_resolver_is_supported (resolver))
- return resolver;
-
- g_object_unref (resolver);
- }
- }
-
- for (l = g_io_extension_point_get_extensions (ep); l != NULL; l = l->next)
- {
- extension = l->data;
-
- resolver = g_object_new (g_io_extension_get_type (extension), NULL);
-
- if (g_proxy_resolver_is_supported (resolver))
- return resolver;
-
- g_object_unref (resolver);
- }
-
- return NULL;
-}
-
/**
* g_proxy_resolver_get_default:
*
* Gets the default #GProxyResolver for the system.
*
- * Return value: (transfer none): the default #GProxyResolver.
+ * Returns: (transfer none): the default #GProxyResolver.
*
* Since: 2.26
*/
GProxyResolver *
g_proxy_resolver_get_default (void)
{
- static GOnce once_init = G_ONCE_INIT;
-
- return g_once (&once_init, get_default_proxy_resolver, NULL);
+ return _g_io_module_get_default (G_PROXY_RESOLVER_EXTENSION_POINT_NAME,
+ "GIO_USE_PROXY_RESOLVER",
+ (GIOModuleVerifyFunc)g_proxy_resolver_is_supported);
}
/**
* internally; g_proxy_resolver_get_default() will only return a proxy
* resolver that returns %TRUE for this method.)
*
- * Return value: %TRUE if @resolver is supported.
+ * Returns: %TRUE if @resolver is supported.
*
* Since: 2.26
*/
* @error: return location for a #GError, or %NULL
*
* Looks into the system proxy configuration to determine what proxy,
- * if any, to use to connect to @uri. The returned proxy URIs are of the
- * form <literal><protocol>://[user[:password]@]host:port</literal>
- * or <literal>direct://</literal>, where <protocol> could be
- * http, rtsp, socks or other proxying protocol.
+ * if any, to use to connect to @uri. The returned proxy URIs are of
+ * the form `<protocol>://[user[:password]@]host:port` or
+ * `direct://`, where <protocol> could be http, rtsp, socks
+ * or other proxying protocol.
*
* If you don't know what network protocol is being used on the
- * socket, you should use <literal>none</literal> as the URI protocol.
+ * socket, you should use `none` as the URI protocol.
* In this case, the resolver might still return a generic proxy type
* (such as SOCKS), but would not return protocol-specific proxy types
* (such as http).
*
- * <literal>direct://</literal> is used when no proxy is needed.
+ * `direct://` is used when no proxy is needed.
* Direct connection should not be attempted unless it is part of the
* returned array of proxies.
*
- * Return value: (transfer full) (array zero-terminated=1): A
+ * Returns: (transfer full) (array zero-terminated=1): A
* NULL-terminated array of proxy URIs. Must be freed
* with g_strfreev().
*
* g_proxy_resolver_lookup_async() is complete. See
* g_proxy_resolver_lookup() for more details.
*
- * Return value: (transfer full) (array zero-terminated=1): A
+ * Returns: (transfer full) (array zero-terminated=1): A
* NULL-terminated array of proxy URIs. Must be freed
* with g_strfreev().
*