comparison src/html.c @ 253:5b28ef2b550e

[gaim-migrate @ 263] A few things happened in this update: - Commented out the libfaim deny/permit list stuff because it's seriously buggy - Added Socks v4 support - improved proxy support for things like getting users' info - i think that's it committer: Tailor Script <tailor@pidgin.im>
author Eric Warmenhoven <eric@warmenhoven.org>
date Tue, 23 May 2000 05:26:30 +0000
parents c8854c4b66cc
children f8a29745247c
comparison
equal deleted inserted replaced
252:4a41f8323022 253:5b28ef2b550e
100 struct g_url website; 100 struct g_url website;
101 char *webdata = NULL; 101 char *webdata = NULL;
102 int sock; 102 int sock;
103 int len; 103 int len;
104 int datalen = 0; 104 int datalen = 0;
105 struct hostent *host; 105 struct in_addr *host;
106 struct sockaddr_in site;
107 char buf[256]; 106 char buf[256];
108 char data; 107 char data;
109 FILE *sockfile; 108 FILE *sockfile;
110 int startsaving = 0; 109 int startsaving = 0;
111 GtkWidget *pw = NULL, *pbar = NULL, *label; 110 GtkWidget *pw = NULL, *pbar = NULL, *label;
112 111
113 website = parse_url(url); 112 website = parse_url(url);
114 113
114 /*
115 host = gethostbyname(website.address); 115 host = gethostbyname(website.address);
116 if (!host) { return g_strdup("g001: Error resolving host\n"); } 116 if (!host) { return g_strdup("g001: Error resolving host\n"); }
117 117
118 site.sin_family = AF_INET; 118 if ((sock = connect_address(inet_addr(host->h_addr), website.port)) <= -1)
119 site.sin_addr.s_addr = *(long *)(host->h_addr); 119 return g_strdup("g003: Error opening connection.\n");
120 site.sin_port = htons(website.port); 120 */
121 121 host = (struct in_addr *)get_address(website.address);
122 sock = socket(AF_INET, SOCK_STREAM, 0); 122 if (!host) { return g_strdup("g001: Error resolving host\n"); }
123 if (sock < 0) { return g_strdup("g002: Socket Error\n"); } 123 if ((sock = connect_address(host->s_addr, website.port)) < 0)
124
125 if (connect(sock, (struct sockaddr *)&site, sizeof(site)))
126 return g_strdup("g003: Error opening connection.\n"); 124 return g_strdup("g003: Error opening connection.\n");
127 125
128 sockfile = fdopen(sock, "r+"); 126 sockfile = fdopen(sock, "r+");
129 127
130 g_snprintf(buf, sizeof(buf), "GET /%s HTTP/1.0\n\n", website.page); 128 g_snprintf(buf, sizeof(buf), "GET /%s HTTP/1.0\n\n", website.page);