1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
3 * soup-proxy-uri-resolver.c: HTTP proxy resolver interface, take 2
5 * Copyright (C) 2009 Red Hat, Inc.
12 #undef SOUP_VERSION_MIN_REQUIRED
13 #define SOUP_VERSION_MIN_REQUIRED SOUP_VERSION_2_42
15 #include "soup-proxy-uri-resolver.h"
19 * SECTION:soup-proxy-uri-resolver
20 * @short_description: Interface for locating HTTP proxies
22 * #SoupProxyURIResolver is an interface for finding appropriate HTTP
25 * Deprecated: #SoupSession now has a #SoupSession:proxy-resolver
26 * property that takes a #GProxyResolver (which is semantically
27 * identical to #SoupProxyURIResolver).
29 * Even in older releases of libsoup, you are not likely to have to
30 * implement this interface on your own; instead, you should usually
31 * just be able to use #SoupProxyResolverDefault.
34 G_DEFINE_INTERFACE_WITH_CODE (SoupProxyURIResolver, soup_proxy_uri_resolver, G_TYPE_OBJECT,
35 g_type_interface_add_prerequisite (g_define_type_id, SOUP_TYPE_SESSION_FEATURE);
39 soup_proxy_uri_resolver_default_init (SoupProxyURIResolverInterface *iface)
44 * SoupProxyURIResolverCallback:
45 * @resolver: the #SoupProxyURIResolver
46 * @status: a #SoupStatus
47 * @proxy_uri: the resolved proxy URI, or %NULL
48 * @user_data: data passed to soup_proxy_uri_resolver_get_proxy_uri_async()
50 * Callback for soup_proxy_uri_resolver_get_proxy_uri_async()
54 * soup_proxy_uri_resolver_get_proxy_uri_async:
55 * @proxy_uri_resolver: the #SoupProxyURIResolver
56 * @uri: the #SoupURI you want a proxy for
57 * @async_context: (allow-none): the #GMainContext to invoke @callback in
58 * @cancellable: a #GCancellable, or %NULL
59 * @callback: (scope async): callback to invoke with the proxy address
60 * @user_data: data for @callback
62 * Asynchronously determines a proxy URI to use for @msg and calls
67 * Deprecated: #SoupProxyURIResolver is deprecated in favor of
71 soup_proxy_uri_resolver_get_proxy_uri_async (SoupProxyURIResolver *proxy_uri_resolver,
73 GMainContext *async_context,
74 GCancellable *cancellable,
75 SoupProxyURIResolverCallback callback,
78 SOUP_PROXY_URI_RESOLVER_GET_CLASS (proxy_uri_resolver)->
79 get_proxy_uri_async (proxy_uri_resolver, uri,
80 async_context, cancellable,
85 * soup_proxy_uri_resolver_get_proxy_uri_sync:
86 * @proxy_uri_resolver: the #SoupProxyURIResolver
87 * @uri: the #SoupURI you want a proxy for
88 * @cancellable: a #GCancellable, or %NULL
89 * @proxy_uri: (out): on return, will contain the proxy URI
91 * Synchronously determines a proxy URI to use for @uri. If @uri
92 * should be sent via proxy, *@proxy_uri will be set to the URI of the
93 * proxy, else it will be set to %NULL.
95 * Return value: %SOUP_STATUS_OK if successful, or a transport-level
100 * Deprecated: #SoupProxyURIResolver is deprecated in favor of
104 soup_proxy_uri_resolver_get_proxy_uri_sync (SoupProxyURIResolver *proxy_uri_resolver,
106 GCancellable *cancellable,
109 return SOUP_PROXY_URI_RESOLVER_GET_CLASS (proxy_uri_resolver)->
110 get_proxy_uri_sync (proxy_uri_resolver, uri, cancellable, proxy_uri);