Mercurial > pidgin
changeset 8889:ae3f33870550
[gaim-migrate @ 9658]
Get rid of a big old ugly function in proxy.c that was #if 0'ed out.
committer: Tailor Script <tailor@pidgin.im>
author | Mark Doliner <mark@kingant.net> |
---|---|
date | Thu, 06 May 2004 05:42:41 +0000 |
parents | 8592f296db16 |
children | 6c98b883580a |
files | src/proxy.c src/util.c |
diffstat | 2 files changed, 5 insertions(+), 105 deletions(-) [+] |
line wrap: on
line diff
--- a/src/proxy.c Thu May 06 05:32:35 2004 +0000 +++ b/src/proxy.c Thu May 06 05:42:41 2004 +0000 @@ -789,111 +789,6 @@ #define HTTP_GOODSTRING "HTTP/1.0 200" #define HTTP_GOODSTRING2 "HTTP/1.1 200" -#if 0 -/* QQQ */ -static void -http_uri_get_host(const char *uri) -{ - GaimProxyInfo *info; - - char *c, *d; - char buffer[2048]; - - char host[128]; - char user[128]; - char pass[128]; - int port = 0; - int len = 0; - - host[0] = '\0'; - user[0] = '\0'; - pass[0] = '\0'; - - gaim_debug(GAIM_DEBUG_MISC, "gaimrc", - "gaimrc_parse_proxy_uri(%s)\n", proxy); - - if ((c = strchr(proxy, ':')) == NULL) - { - gaim_debug(GAIM_DEBUG_ERROR, "gaimrc", - "No URI detected.\n"); - /* No URI detected. */ - return FALSE; - } - - len = c - proxy; - - if (strncmp(proxy, "http://", len + 3)) - return FALSE; - - gaim_debug(GAIM_DEBUG_MISC, "gaimrc", "Found HTTP proxy.\n"); - /* Get past "://" */ - c += 3; - - gaim_debug(GAIM_DEBUG_MISC, "gaimrc", "Looking at %s\n", c); - - for (;;) - { - *buffer = '\0'; - d = buffer; - - while (*c != '\0' && *c != '@' && *c != ':' && *c != '/') - *d++ = *c++; - - *d = '\0'; - - if (*c == ':') - { - /* - * If there is a '@' in there somewhere, we are in the auth part. - * If not, host. - */ - if (strchr(c, '@') != NULL) - strcpy(user, buffer); - else - strcpy(host, buffer); - } - else if (*c == '@') - { - if (user[0] == '\0') - strcpy(user, buffer); - else - strcpy(pass, buffer); - } - else if (*c == '/' || *c == '\0') - { - if (host[0] == '\0') - strcpy(host, buffer); - else - port = atoi(buffer); - - /* Done. */ - break; - } - - c++; - } - - /* NOTE: HTTP_PROXY takes precedence. */ - info = gaim_global_proxy_get_info(); - - if (*host) gaim_proxy_info_set_host(info, host); - if (*user) gaim_proxy_info_set_username(info, user); - if (*pass) gaim_proxy_info_set_password(info, pass); - - gaim_proxy_info_set_port(info, port); - - gaim_debug(GAIM_DEBUG_MISC, "gaimrc", - "Host: '%s', User: '%s', Password: '%s', Port: %d\n", - gaim_proxy_info_get_host(info), - gaim_proxy_info_get_username(info), - gaim_proxy_info_get_password(info), - gaim_proxy_info_get_port(info)); - - return TRUE; -} -#endif - - static void http_complete(struct PHB *phb, gint source) {
--- a/src/util.c Thu May 06 05:32:35 2004 +0000 +++ b/src/util.c Thu May 06 05:42:41 2004 +0000 @@ -2105,6 +2105,11 @@ /************************************************************************** * URI/URL Functions **************************************************************************/ +/* + * XXX - Make this also support extracting a username and password? + * Would be nice when dissecting an environmental variable + * that specifies proxy information. + */ gboolean gaim_url_parse(const char *url, char **ret_host, int *ret_port, char **ret_path)