comparison 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
comparison
equal deleted inserted replaced
1086:ce201056e7a6 1087:56c7ceb986a8
98 98
99 sscanf(port, "%d", &test.port); 99 sscanf(port, "%d", &test.port);
100 return test; 100 return test;
101 } 101 }
102 102
103 char *grab_url(char *url) 103 char *grab_url(struct aim_user *user, char *url)
104 { 104 {
105 struct g_url website; 105 struct g_url website;
106 char *webdata = NULL; 106 char *webdata = NULL;
107 int sock; 107 int sock;
108 int len; 108 int len;
114 int startsaving = 0; 114 int startsaving = 0;
115 GtkWidget *pw = NULL, *pbar = NULL, *label; 115 GtkWidget *pw = NULL, *pbar = NULL, *label;
116 116
117 website = parse_url(url); 117 website = parse_url(url);
118 118
119 host = (struct in_addr *)get_address(website.address); 119 if (user) {
120 if (!host) { return g_strdup(_("g001: Error resolving host\n")); } 120 if ((sock = proxy_connect(website.address, website.port, user->proto_opt[2],
121 if ((sock = connect_address(host->s_addr, website.port)) < 0) 121 user->proto_opt[3], atoi(user->proto_opt[4]))) < 0)
122 return g_strdup(_("g003: Error opening connection.\n")); 122 return g_strdup(_("g003: Error opening connection.\n"));
123 } else {
124 if ((sock = proxy_connect(website.address, website.port, NULL, NULL, -1)) < 0)
125 return g_strdup(_("g003: Error opening connection.\n"));
126 }
123 127
124 g_snprintf(buf, sizeof(buf), "GET /%s HTTP/1.0\r\n\r\n", website.page); 128 g_snprintf(buf, sizeof(buf), "GET /%s HTTP/1.0\r\n\r\n", website.page);
125 g_snprintf(debug_buff, sizeof(debug_buff), "Request: %s\n", buf); 129 g_snprintf(debug_buff, sizeof(debug_buff), "Request: %s\n", buf);
126 debug_print(debug_buff); 130 debug_print(debug_buff);
127 write(sock, buf, strlen(buf)); 131 write(sock, buf, strlen(buf));