GNOME Bugzilla – Bug 605065
Make soup_session_prepare_for_uri handle proxies (patch attached)
Last modified: 2012-03-13 16:23:58 UTC
Created attachment 150110 [details] [review] Patch for making soup_session_prepare_for_uri handle proxies This patch makes soup_session_prepare_for_uri checking if an URI should use a proxy, and in that case it prefetchs the proxy address.
Comment on attachment 150110 [details] [review] Patch for making soup_session_prepare_for_uri handle proxies >+ udata = g_slice_alloc(2*sizeof(gpointer)); >+ udata[0] = session; >+ udata[1] = soup_uri_copy(uri); no. use a real struct. >+ soup_proxy_uri_resolver_get_proxy_uri_async (proxy_uri_resolver, uri, priv->async_context, >+ NULL, soup_session_prepare_for_uri_proxy_cb, >+ udata); ok, unlike in the address case, you actually have to save the result somewhere. You could store the last-prefetched URI and its corresponding proxy-URI in SoupSessionPrivate, and then when the next request comes in, if it's the one you have a proxy-URI cached for, use that proxy-uri right away rather than re-resolving it.
Created attachment 150316 [details] [review] Patch for making soup_session_prepare_for_uri handle proxies (new version) I think this patch solves the problems commented by Dan. This patch makes SoupSession have a hashtable which acts as a proxy URIs cache. If one proxy URI is to be resolved, SoupSession search for it in that hash table, and if it was added a proxy URI for the original URI in the last 30 seconds (defined in soup-session-private.h), then it will use the cached value. It also prefetchs the IP of the proxy host.
Created attachment 163075 [details] [review] soup_session_prepare_for_uri: do proxy lookup as well Here's a new version (which requires the very latest libsoup git master). Rather than adding API to SoupSession to do caching, this just does the caching within SoupProxyResolverGNOME. It only caches a single URI, but that should generally be enough; the idea is mostly just to look up the proxy as soon as the user mouses over the link, and to have finished before they click it. does this work for you?
ugh, this patch won't work; I was thinking we only did prepare_for_uri on mouseover, but it appears that webkit is calling it for every link it sees on the page. I'm not convinced we want to be doing proxy pre-resolution on every single link; in the PAC case that will require running some unknown amount of javascript on each one. What would be better would be to tie this into the hovering-over-a-link signal.
This isn't happening, qv https://bugs.webkit.org/show_bug.cgi?id=80997