# HG changeset patch # User Mark Doliner # Date 1083822161 0 # Node ID ae3f33870550f8d4fa2301e89bfc5e6af1c28b76 # Parent 8592f296db1613c954447423c78c99a8e01ad258 [gaim-migrate @ 9658] Get rid of a big old ugly function in proxy.c that was #if 0'ed out. committer: Tailor Script diff -r 8592f296db16 -r ae3f33870550 src/proxy.c --- 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) { diff -r 8592f296db16 -r ae3f33870550 src/util.c --- 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)