GNOME Bugzilla – Bug 709758
GDataService: Support GProxyResolver
Last modified: 2013-10-23 08:34:41 UTC
Created attachment 256840 [details] [review] Proposed patch libsoup 2.42 added a GProxyResolver r/w property to SoupSession. It would be nice if GDataService provided access to it. SoupSession still supports its "proxy-uri" property, which GDataService's "proxy-uri" property is effectively bound to. SoupSession handles this by unsetting its "proxy-uri" property when its "proxy-resolver" property is set, and vice versa. Therefore GDataService can just add its own "proxy-resolver" property as a pass through to SoupSession's "proxy-resolver" property, and let SoupSession sort out the "proxy-resolver" vs "proxy-uri". This does require a libsoup requirement bump, if you're okay with that.
Review of attachment 256840 [details] [review]: Committed with a few changes (some of which are listed below), plus changes to deprecate GDataService:proxy-uri. Thanks! commit 8f1923fcd9c4203f68ce6a0405526500a77783e5 Author: Matthew Barnes <mbarnes@redhat.com> Date: Wed Oct 9 12:54:11 2013 -0400 core: Add a "proxy-resolver" property. Bound to SoupSession's "proxy-resolver" property. This also bumps the libsoup requirement to 2.42. This deprecates the following API: • GDataService:proxy-uri • gdata_service_[get|set]_proxy_uri() and adds the following new API: • GDataService:proxy-resolver • gdata_service_[get|set]_proxy_resolver() Helps: https://bugzilla.gnome.org/show_bug.cgi?id=709758 configure.ac | 2 +- docs/reference/gdata-sections.txt | 2 ++ gdata/gdata-service.c | 113 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++----------- gdata/gdata-service.h | 9 +++++++-- gdata/gdata.symbols | 2 ++ 5 files changed, 114 insertions(+), 14 deletions(-) ::: gdata/gdata-service.c @@ +1879,3 @@ + * Gets the #GProxyResolver on the #GDataService's #SoupSession. + * + * Return value: (transfer none): a #GProxyResolver, or %NULL This needs an (allow-none) annotation. @@ +1908,3 @@ + + if (proxy_resolver != NULL) { + g_return_if_fail (G_IS_PROXY_RESOLVER (proxy_resolver)); It would be neater to implement this as a top-level: g_return_if_fail (proxy_resolver == NULL || G_IS_PROXY_RESOLVER (proxy_resolver));
However, this bug can’t be closed until GDataClientLoginAuthorizer:proxy-resolver and GDataOAuth1Authorizer:proxy-resolver are added too.
Thanks. I found out I misspoke when we chatted on IRC. SoupSession has not actually deprecated its "proxy-uri" property. It co-exists peacefully with "proxy-resolver". So you don't *need* to deprecate your APIs unless you'd prefer to.
commit 3ed33acfa1012f1795907c864d0b3d9a81285140 Author: Philip Withnall <philip@tecnocode.co.uk> Date: Sat Oct 12 09:28:10 2013 +0100 core: Add a GDataOAuth1Authorizer:proxy-resolver property Bound to SoupSession’s ‘proxy-resolver’ property. Based on commit 8f1923fcd9c4203f68ce6a0405526500a77783e5 by Matthew Barnes <mbarnes@redhat.c This deprecates the following API: • GDataOAuth1Authorizer:proxy-uri • gdata_oauth1_authorizer_[get|set]_proxy_uri() and adds the following new API: • GDataOAuth1Authorizer:proxy-resolver • gdata_oauth1_authorizer_[get|set]_proxy_resolver() Closes: https://bugzilla.gnome.org/show_bug.cgi?id=709758 docs/reference/gdata-sections.txt | 2 + gdata/gdata-oauth1-authorizer.c | 123 +++++++++++++++++++++++++++++++++----- gdata/gdata-oauth1-authorizer.h | 9 ++- gdata/gdata.symbols | 2 + gdata/tests/oauth1-authorizer.c | 66 ++++++++++---------- 5 files changed, 151 insertions(+), 51 deletions(-) commit 4647e0b5cd60cb5429c14e77733bb6e423d27472 Author: Philip Withnall <philip@tecnocode.co.uk> Date: Sat Oct 12 09:25:42 2013 +0100 core: Add a GDataClientLoginAuthorizer:proxy-resolver property Bound to SoupSession’s ‘proxy-resolver’ property. Based on commit 8f1923fcd9c4203f68ce6a0405526500a77783e5 by Matthew Barnes <mbarnes@redhat.c This deprecates the following API: • GDataClientLoginAuthorizer:proxy-uri • gdata_client_login_authorizer_[get|set]_proxy_uri() and adds the following new API: • GDataClientLoginAuthorizer:proxy-resolver • gdata_client_login_authorizer_[get|set]_proxy_resolver() Helps: https://bugzilla.gnome.org/show_bug.cgi?id=709758 docs/reference/gdata-sections.txt | 2 + gdata/gdata-client-login-authorizer.c | 123 +++++++++++++++++++++++++++++----- gdata/gdata-client-login-authorizer.h | 9 ++- gdata/gdata.symbols | 2 + gdata/tests/client-login-authorizer.c | 66 +++++++++--------- 5 files changed, 151 insertions(+), 51 deletions(-)