Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:jberkman
evolution-data-server-2.6
bnc-255432-auth-proxy.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File bnc-255432-auth-proxy.patch of Package evolution-data-server-2.6
--- libedataserver/e-proxy.c.current 2007-03-16 16:21:01.212495487 +0100 +++ libedataserver/e-proxy.c 2007-03-16 16:16:45.821854078 +0100 @@ -96,6 +96,7 @@ static void e_proxy_dispose (GObject* static void ipv6_network_addr (const struct in6_addr *addr, const struct in6_addr *mask, struct in6_addr *res); +static void ep_free_ignore_list (EProxy *proxy); static void ep_free_proxy_host_addr (ProxyHostAddr* host) @@ -179,17 +180,9 @@ e_proxy_dispose (GObject *object) if (priv->uri) soup_uri_free (priv->uri); - - if (priv->ign_hosts) { - g_slist_foreach (priv->ign_hosts, (GFunc) ep_free_proxy_host_addr, NULL); - g_slist_free (priv->ign_hosts); - } - - if (priv->ign_addrs) { - g_slist_foreach (priv->ign_addrs, (GFunc) g_free, NULL); - g_slist_free (priv->ign_addrs); - } + ep_free_ignore_list (proxy); + priv->notify_id = 0; g_free (priv); @@ -197,6 +190,26 @@ e_proxy_dispose (GObject *object) } } +static void +ep_free_ignore_list (EProxy *proxy) +{ + EProxyPrivate* priv = NULL; + if (!proxy || !proxy->priv) + return; + + priv = proxy->priv; + + if (priv->ign_hosts) { + g_slist_foreach (priv->ign_hosts, (GFunc) ep_free_proxy_host_addr, NULL); + g_slist_free (priv->ign_hosts); + } + + if (priv->ign_addrs) { + g_slist_foreach (priv->ign_addrs, (GFunc) g_free, NULL); + g_slist_free (priv->ign_addrs); + } +} + GType e_proxy_get_type (void) { @@ -496,19 +509,24 @@ ep_parse_ignore_host (gpointer data, gpo static void ep_set_proxy (GConfClient *client, gpointer user_data, - gboolean regen_ign_host_list, - gboolean set_auth) + gboolean regen_ign_host_list) { char *proxy_server = NULL, *proxy_user = NULL, *proxy_pw = NULL, *uri = NULL; gboolean use_auth; int proxy_port; EProxy* proxy = (EProxy *)user_data; - EProxyPrivate* priv = proxy->priv; + EProxyPrivate* priv = NULL; GSList *ignore; + if (!proxy || !proxy->priv) + return; + + priv = proxy->priv; + priv->use_proxy = gconf_client_get_bool (client, KEY_GCONF_USE_HTTP_PROXY, NULL); if (priv->use_proxy == FALSE) { if (priv->uri) { + ep_free_ignore_list (proxy); soup_uri_free (priv->uri); priv->uri = NULL; } @@ -517,22 +535,9 @@ ep_set_proxy (GConfClient *client, proxy_server = gconf_client_get_string (client, KEY_GCONF_HTTP_PROXY_HOST, NULL); proxy_port = gconf_client_get_int (client, KEY_GCONF_HTTP_PROXY_PORT, NULL); - uri = g_strdup_printf ("http://%s:%d", proxy_server, proxy_port); - d(g_print ("ep_set_proxy: uri: %s\n", uri)); if (regen_ign_host_list) { - if (priv->ign_hosts) { - g_slist_foreach (priv->ign_hosts, (GFunc) g_free, NULL); - g_slist_free (priv->ign_hosts); - priv->ign_hosts = NULL; - } - - if (priv->ign_addrs) { - g_slist_foreach (priv->ign_addrs, (GFunc) g_free, NULL); - g_slist_free (priv->ign_addrs); - priv->ign_addrs = NULL; - } - + ep_free_ignore_list (proxy); ignore = gconf_client_get_list (client, KEY_GCONF_HTTP_PROXY_IGNORE_HOSTS, GCONF_VALUE_STRING, NULL); if (ignore) { @@ -540,34 +545,33 @@ ep_set_proxy (GConfClient *client, g_slist_foreach (ignore, (GFunc) g_free, NULL); g_slist_free (ignore); } - } else if (set_auth) { - - use_auth = gconf_client_get_bool (client, KEY_GCONF_HTTP_USE_AUTH, NULL); - if (use_auth == TRUE) { - proxy_user = gconf_client_get_string (client, KEY_GCONF_HTTP_AUTH_USER, NULL); - proxy_pw = gconf_client_get_string (client, KEY_GCONF_HTTP_AUTH_PW, NULL); - - if (uri) - g_free (uri); - - uri = g_strdup_printf ("http://%s:%s@%s:%d", proxy_user, proxy_pw, proxy_server, proxy_port); - } - } + } + use_auth = gconf_client_get_bool (client, KEY_GCONF_HTTP_USE_AUTH, NULL); + if (use_auth == TRUE) { + proxy_user = gconf_client_get_string (client, KEY_GCONF_HTTP_AUTH_USER, NULL); + proxy_pw = gconf_client_get_string (client, KEY_GCONF_HTTP_AUTH_PW, NULL); + } if (priv->uri) { soup_uri_free (priv->uri); priv->uri = NULL; } - if (uri) + if (proxy_server) { + uri = g_strdup_printf ("http://%s:%d", proxy_server, proxy_port); priv->uri = soup_uri_new (uri); - d(g_print ("system-proxy: uri: %s\n", uri)); + priv->uri->user = g_strdup (proxy_user); + priv->uri->passwd = g_strdup (proxy_pw); + g_free (uri); + } + + g_free (proxy_user); + g_free (proxy_pw); + g_free (proxy_server); emit_signal: g_signal_emit (proxy, signals[CHANGED], 0); - g_free (uri); - return; } @@ -577,28 +581,16 @@ ep_setting_changed (GConfClient *client, { const char *key; EProxy* proxy = (EProxy *)user_data; + gboolean regen_ign_host_list = FALSE; if (!proxy || !proxy->priv) return; key = gconf_entry_get_key(entry); - if (strcmp(key, KEY_GCONF_USE_HTTP_PROXY) == 0 - || strcmp(key, KEY_GCONF_HTTP_PROXY_IGNORE_HOSTS) == 0 - || strcmp(key, KEY_GCONF_HTTP_PROXY_HOST) == 0 - || strcmp(key, KEY_GCONF_HTTP_PROXY_PORT) == 0) { - gboolean regen_ign_host_list = FALSE; - - if (strcmp(key, KEY_GCONF_HTTP_PROXY_IGNORE_HOSTS) == 0) - regen_ign_host_list = TRUE; - ep_set_proxy (client, user_data, regen_ign_host_list, FALSE); - d(g_print ("e-proxy.c:ep_settings_changed: proxy settings changed\n")); - } else if (strcmp(key, KEY_GCONF_HTTP_AUTH_USER) == 0 - || strcmp(key, KEY_GCONF_HTTP_AUTH_PW) == 0 - || strcmp(key, KEY_GCONF_HTTP_USE_AUTH) == 0) { - ep_set_proxy (client, user_data, FALSE, TRUE); - d(g_print ("e-proxy.c:ep_settings_changed: auth settings changed\n")); - } + if (strcmp(key, KEY_GCONF_HTTP_PROXY_IGNORE_HOSTS) == 0) + regen_ign_host_list = TRUE; + ep_set_proxy (client, user_data, regen_ign_host_list); } EProxy* @@ -635,7 +627,7 @@ e_proxy_setup_proxy (EProxy* proxy) ep_setting_changed, (gpointer)proxy, NULL, NULL); - ep_set_proxy (client, proxy, TRUE, TRUE); + ep_set_proxy (client, proxy, TRUE); g_object_unref (client); }
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor