diff src/html.c @ 1087:56c7ceb986a8

[gaim-migrate @ 1097] thank god, someone finally redid the proxy stuff. i think most of it works even. isn't that neat? thanks adam. committer: Tailor Script <tailor@pidgin.im>
author Eric Warmenhoven <eric@warmenhoven.org>
date Sun, 12 Nov 2000 23:54:07 +0000
parents 104a2659b358
children 18a14e6dd0af
line wrap: on
line diff
--- a/src/html.c	Sun Nov 12 14:14:12 2000 +0000
+++ b/src/html.c	Sun Nov 12 23:54:07 2000 +0000
@@ -100,7 +100,7 @@
 	return test;
 }
 
-char *grab_url(char *url)
+char *grab_url(struct aim_user *user, char *url)
 {
 	struct g_url website;
 	char *webdata = NULL;
@@ -116,10 +116,14 @@
 
         website = parse_url(url);
 
-	host = (struct in_addr *)get_address(website.address);
-	if (!host) { return g_strdup(_("g001: Error resolving host\n")); }
-	if ((sock = connect_address(host->s_addr, website.port)) < 0)
-		return g_strdup(_("g003: Error opening connection.\n"));
+	if (user) {
+		if ((sock = proxy_connect(website.address, website.port, user->proto_opt[2],
+					user->proto_opt[3], atoi(user->proto_opt[4]))) < 0)
+			return g_strdup(_("g003: Error opening connection.\n"));
+	} else {
+		if ((sock = proxy_connect(website.address, website.port, NULL, NULL, -1)) < 0)
+			return g_strdup(_("g003: Error opening connection.\n"));
+	}
 
 	g_snprintf(buf, sizeof(buf), "GET /%s HTTP/1.0\r\n\r\n", website.page);
 	g_snprintf(debug_buff, sizeof(debug_buff), "Request: %s\n", buf);