Mercurial > pidgin
comparison libgaim/proxy.c @ 14979:c157efddc62a
[gaim-migrate @ 17758]
Don't lose the account proxy settings just because they are hidden and not in use.
Also, make the MSN HTTP method use the same proxy setup code as the core - this should improve env. var proxy handling.
committer: Tailor Script <tailor@pidgin.im>
author | Daniel Atallah <daniel.atallah@gmail.com> |
---|---|
date | Thu, 16 Nov 2006 04:58:40 +0000 |
parents | 721465a37d4e |
children |
comparison
equal
deleted
inserted
replaced
14978:f719225f988e | 14979:c157efddc62a |
---|---|
1683 } | 1683 } |
1684 | 1684 |
1685 GaimProxyInfo * | 1685 GaimProxyInfo * |
1686 gaim_proxy_get_setup(GaimAccount *account) | 1686 gaim_proxy_get_setup(GaimAccount *account) |
1687 { | 1687 { |
1688 GaimProxyInfo *gpi; | 1688 GaimProxyInfo *gpi = NULL; |
1689 const gchar *tmp; | 1689 const gchar *tmp; |
1690 | 1690 |
1691 /* This is used as a fallback so we don't overwrite the selected proxy type */ | 1691 /* This is used as a fallback so we don't overwrite the selected proxy type */ |
1692 static GaimProxyInfo *tmp_none_proxy_info = NULL; | 1692 static GaimProxyInfo *tmp_none_proxy_info = NULL; |
1693 if (!tmp_none_proxy_info) { | 1693 if (!tmp_none_proxy_info) { |
1694 tmp_none_proxy_info = gaim_proxy_info_new(); | 1694 tmp_none_proxy_info = gaim_proxy_info_new(); |
1695 gaim_proxy_info_set_type(tmp_none_proxy_info, GAIM_PROXY_NONE); | 1695 gaim_proxy_info_set_type(tmp_none_proxy_info, GAIM_PROXY_NONE); |
1696 } | 1696 } |
1697 | 1697 |
1698 if (account && gaim_account_get_proxy_info(account) != NULL) | 1698 if (account && gaim_account_get_proxy_info(account) != NULL) { |
1699 gpi = gaim_account_get_proxy_info(account); | 1699 gpi = gaim_account_get_proxy_info(account); |
1700 else if (gaim_running_gnome()) | 1700 if (gaim_proxy_info_get_type(gpi) == GAIM_PROXY_USE_GLOBAL) |
1701 gpi = gaim_gnome_proxy_get_info(); | 1701 gpi = NULL; |
1702 else | 1702 } |
1703 gpi = gaim_global_proxy_get_info(); | 1703 if (gpi == NULL) { |
1704 if (gaim_running_gnome()) | |
1705 gpi = gaim_gnome_proxy_get_info(); | |
1706 else | |
1707 gpi = gaim_global_proxy_get_info(); | |
1708 } | |
1704 | 1709 |
1705 if (gaim_proxy_info_get_type(gpi) == GAIM_PROXY_USE_ENVVAR) { | 1710 if (gaim_proxy_info_get_type(gpi) == GAIM_PROXY_USE_ENVVAR) { |
1706 #ifdef _WIN32 | 1711 #ifdef _WIN32 |
1707 wgaim_check_for_proxy_changes(); | 1712 wgaim_check_for_proxy_changes(); |
1708 #endif | 1713 #endif |
1731 (tmp = g_getenv("http_proxy_port")) != NULL || | 1736 (tmp = g_getenv("http_proxy_port")) != NULL || |
1732 (tmp = g_getenv("HTTPPROXYPORT")) != NULL)) | 1737 (tmp = g_getenv("HTTPPROXYPORT")) != NULL)) |
1733 proxyport = atoi(tmp); | 1738 proxyport = atoi(tmp); |
1734 | 1739 |
1735 gaim_proxy_info_set_port(gpi, proxyport); | 1740 gaim_proxy_info_set_port(gpi, proxyport); |
1741 | |
1742 /* XXX: Do we want to skip this step if user/password were part of url? */ | |
1743 if ((tmp = g_getenv("HTTP_PROXY_USER")) != NULL || | |
1744 (tmp = g_getenv("http_proxy_user")) != NULL || | |
1745 (tmp = g_getenv("HTTPPROXYUSER")) != NULL) | |
1746 gaim_proxy_info_set_username(gpi, tmp); | |
1747 | |
1748 if ((tmp = g_getenv("HTTP_PROXY_PASS")) != NULL || | |
1749 (tmp = g_getenv("http_proxy_pass")) != NULL || | |
1750 (tmp = g_getenv("HTTPPROXYPASS")) != NULL) | |
1751 gaim_proxy_info_set_password(gpi, tmp); | |
1752 | |
1736 } | 1753 } |
1737 } else { | 1754 } else { |
1738 /* no proxy environment variable found, don't use a proxy */ | 1755 /* no proxy environment variable found, don't use a proxy */ |
1739 gaim_debug_info("proxy", "No environment settings found, not using a proxy\n"); | 1756 gaim_debug_info("proxy", "No environment settings found, not using a proxy\n"); |
1740 gpi = tmp_none_proxy_info; | 1757 gpi = tmp_none_proxy_info; |
1741 } | 1758 } |
1742 | 1759 |
1743 /* XXX: Do we want to skip this step if user/password were part of url? */ | |
1744 if ((tmp = g_getenv("HTTP_PROXY_USER")) != NULL || | |
1745 (tmp = g_getenv("http_proxy_user")) != NULL || | |
1746 (tmp = g_getenv("HTTPPROXYUSER")) != NULL) | |
1747 gaim_proxy_info_set_username(gpi, tmp); | |
1748 | |
1749 if ((tmp = g_getenv("HTTP_PROXY_PASS")) != NULL || | |
1750 (tmp = g_getenv("http_proxy_pass")) != NULL || | |
1751 (tmp = g_getenv("HTTPPROXYPASS")) != NULL) | |
1752 gaim_proxy_info_set_password(gpi, tmp); | |
1753 } | 1760 } |
1754 | 1761 |
1755 return gpi; | 1762 return gpi; |
1756 } | 1763 } |
1757 | 1764 |