comparison src/proxy.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 985635758c33
children 9d258a0aa560
comparison
equal deleted inserted replaced
252:4a41f8323022 253:5b28ef2b550e
175 return ret; 175 return ret;
176 break; 176 break;
177 case PROXY_SOCKS: /* Socks v4 proxy (? I'm not a proxy hacker) */ 177 case PROXY_SOCKS: /* Socks v4 proxy (? I'm not a proxy hacker) */
178 /* this is going to be a cross between the HTTP proxy code 178 /* this is going to be a cross between the HTTP proxy code
179 * above and the TiK proxy code, translated from tcl->C */ 179 * above and the TiK proxy code, translated from tcl->C */
180 /*
181 { 180 {
182 struct hostent *hostinfo; 181 struct hostent *hostinfo;
183 unsigned short shortport = proxy_port; 182 unsigned short shortport = proxy_port;
184 183
185 memset(&name, 0, sizeof (name)); 184 memset(&name, 0, sizeof (name));
194 } 193 }
195 sprintf(debug_buff,"Trying to connect ...\n"); 194 sprintf(debug_buff,"Trying to connect ...\n");
196 debug_print(debug_buff); 195 debug_print(debug_buff);
197 if ((ret = connect(sockfd,(struct sockaddr *)&name,sizeof(name)))<0) 196 if ((ret = connect(sockfd,(struct sockaddr *)&name,sizeof(name)))<0)
198 return(ret); 197 return(ret);
199 */ 198
200 /* here's where it's no longer http proxy and is now tik */ 199 /* here's where it's no longer http proxy and is now tik */
201 /* { 200 {
202 char cmd[80]; 201 char cmd[80];
203 char *inputline; 202 char *inputline;
204 203 unsigned short realport=((struct sockaddr_in *)serv_addr)->sin_port;
205 snprintf(cmd, 80, "\0x4\0x1%d%d%d%d%d", toc_port, 204 unsigned long realhost=((struct sockaddr_in *)serv_addr)->sin_addr.s_addr;
206 toc_server_1, 205
207 toc_server_2, /* the second part of the 206 cmd[0] = 4; cmd[0] = 1;
208 ip address: 1.this.1.1 207 memcpy(cmd + 2, &realport, 2);
209 *//* 208 memcpy(cmd + 4, &realhost, 4);
210 toc_server_3, 209 cmd[8] = 0;
211 toc_server_4); 210 if (send(sockfd,cmd,8,0)<0)
212 if (send(sockfd,cmd,strlen(cmd),0)<0)
213 return(-1); 211 return(-1);
214 if (proxy_recv_line(sockfd,&inputline) < 0) { 212 if (proxy_recv_line(sockfd,&inputline) < 0) {
215 return(-1); 213 return(-1);
216 }*/ 214 }
215 if (inputline[1] != 90) {
216 sprintf(debug_buff, "request failed: %d\n",
217 inputline[1]);
218 debug_print(debug_buff);
219 if (inputline[1] == 91)
220 do_error_dialog("The SOCKS proxy denied"
221 "your request.",
222 "Gaim - Proxy Error");
223 else
224 do_error_dialog("Unknown SOCKS error.",
225 "Gaim - Proxy Error");
226 return -1;
227 }
228 }
229 return ret;
217 break; 230 break;
218 default: 231 default:
219 fprintf(stderr,"Unknown proxy type : %d.\n",proxy_type); 232 fprintf(stderr,"Unknown proxy type : %d.\n",proxy_type);
220 break; 233 break;
221 } 234 }