comparison src/html.c @ 1881:a02584b98823

[gaim-migrate @ 1891] C:) committer: Tailor Script <tailor@pidgin.im>
author Eric Warmenhoven <eric@warmenhoven.org>
date Wed, 23 May 2001 07:59:05 +0000
parents 4dbd8533d209
children 060161a5d5f8
comparison
equal deleted inserted replaced
1880:b8245bcce7e6 1881:a02584b98823
210 gunk->callback(gunk->data, webdata); 210 gunk->callback(gunk->data, webdata);
211 g_free(gunk->url); 211 g_free(gunk->url);
212 g_free(gunk); 212 g_free(gunk);
213 } 213 }
214 214
215 void grab_url(struct aim_user *user, char *url, void (*callback)(gpointer, char *), gpointer data) 215 void grab_url(char *url, void (*callback)(gpointer, char *), gpointer data)
216 { 216 {
217 int sock; 217 int sock;
218 struct grab_url_data *gunk = g_new0(struct grab_url_data, 1); 218 struct grab_url_data *gunk = g_new0(struct grab_url_data, 1);
219 219
220 gunk->callback = callback; 220 gunk->callback = callback;
221 gunk->data = data; 221 gunk->data = data;
222 gunk->url = g_strdup(url); 222 gunk->url = g_strdup(url);
223 gunk->website = parse_url(url); 223 gunk->website = parse_url(url);
224 224
225 if (user) { 225 if ((sock = proxy_connect(gunk->website.address, gunk->website.port,
226 if ((sock = proxy_connect(gunk->website.address, gunk->website.port, 226 grab_url_callback, gunk)) < 0) {
227 user->proto_opt[2], atoi(user->proto_opt[3]), 227 g_free(gunk->url);
228 atoi(user->proto_opt[4]), 228 g_free(gunk);
229 user->proto_opt[5], user->proto_opt[6], 229 callback(data, g_strdup(_("g003: Error opening connection.\n")));
230 grab_url_callback, gunk)) < 0) { 230 }
231 g_free(gunk->url); 231 }
232 g_free(gunk);
233 callback(data, g_strdup(_("g003: Error opening connection.\n")));
234 }
235 } else {
236 if ((sock = proxy_connect(gunk->website.address, gunk->website.port, NULL, 0, -1,
237 NULL, NULL, grab_url_callback, gunk)) < 0) {
238 g_free(gunk->url);
239 g_free(gunk);
240 callback(data, g_strdup(_("g003: Error opening connection.\n")));
241 }
242 }
243 }