comparison src/proxy.c @ 12991:c1b2ba353e85

[gaim-migrate @ 15344] SF Patch #1411771 from Tim Mooney This fixes some cases where we should be using socklen_t as the variable type. committer: Tailor Script <tailor@pidgin.im>
author Richard Laager <rlaager@wiktel.com>
date Sun, 22 Jan 2006 21:02:52 +0000
parents 36930e2a461e
children e8adf8183cf4
comparison
equal deleted inserted replaced
12990:798ef873a7e9 12991:c1b2ba353e85
921 921
922 static void 922 static void
923 no_one_calls(gpointer data, gint source, GaimInputCondition cond) 923 no_one_calls(gpointer data, gint source, GaimInputCondition cond)
924 { 924 {
925 struct PHB *phb = data; 925 struct PHB *phb = data;
926 unsigned int len; 926 socklen_t len;
927 int error=0, ret; 927 int error=0, ret;
928 928
929 gaim_debug_info("proxy", "Connected.\n"); 929 gaim_debug_info("proxy", "Connected.\n");
930 930
931 len = sizeof(error); 931 len = sizeof(error);
1016 close(fd); 1016 close(fd);
1017 return -1; 1017 return -1;
1018 } 1018 }
1019 } 1019 }
1020 else { 1020 else {
1021 unsigned int len; 1021 socklen_t len;
1022 int error = ETIMEDOUT; 1022 int error = ETIMEDOUT;
1023 gaim_debug_misc("proxy", "Connect didn't block.\n"); 1023 gaim_debug_misc("proxy", "Connect didn't block.\n");
1024 len = sizeof(error); 1024 len = sizeof(error);
1025 if (getsockopt(fd, SOL_SOCKET, SO_ERROR, &error, &len) < 0) { 1025 if (getsockopt(fd, SOL_SOCKET, SO_ERROR, &error, &len) < 0) {
1026 gaim_debug_error("proxy", "getsockopt failed.\n"); 1026 gaim_debug_error("proxy", "getsockopt failed.\n");
1203 http_canwrite(gpointer data, gint source, GaimInputCondition cond) 1203 http_canwrite(gpointer data, gint source, GaimInputCondition cond)
1204 { 1204 {
1205 char request[8192]; 1205 char request[8192];
1206 int request_len = 0; 1206 int request_len = 0;
1207 struct PHB *phb = data; 1207 struct PHB *phb = data;
1208 unsigned int len; 1208 socklen_t len;
1209 int error = ETIMEDOUT; 1209 int error = ETIMEDOUT;
1210 1210
1211 gaim_debug_info("http proxy", "Connected.\n"); 1211 gaim_debug_info("http proxy", "Connected.\n");
1212 1212
1213 if (phb->inpa > 0) 1213 if (phb->inpa > 0)
1294 close(fd); 1294 close(fd);
1295 return -1; 1295 return -1;
1296 } 1296 }
1297 } 1297 }
1298 else { 1298 else {
1299 unsigned int len; 1299 socklen_t len;
1300 int error = ETIMEDOUT; 1300 int error = ETIMEDOUT;
1301 1301
1302 gaim_debug_misc("http proxy", 1302 gaim_debug_misc("http proxy",
1303 "Connect didn't block.\n"); 1303 "Connect didn't block.\n");
1304 1304
1345 s4_canwrite(gpointer data, gint source, GaimInputCondition cond) 1345 s4_canwrite(gpointer data, gint source, GaimInputCondition cond)
1346 { 1346 {
1347 unsigned char packet[12]; 1347 unsigned char packet[12];
1348 struct hostent *hp; 1348 struct hostent *hp;
1349 struct PHB *phb = data; 1349 struct PHB *phb = data;
1350 unsigned int len; 1350 socklen_t len;
1351 int error = ETIMEDOUT; 1351 int error = ETIMEDOUT;
1352 1352
1353 gaim_debug_info("socks4 proxy", "Connected.\n"); 1353 gaim_debug_info("socks4 proxy", "Connected.\n");
1354 1354
1355 if (phb->inpa > 0) 1355 if (phb->inpa > 0)
1428 else { 1428 else {
1429 close(fd); 1429 close(fd);
1430 return -1; 1430 return -1;
1431 } 1431 }
1432 } else { 1432 } else {
1433 unsigned int len; 1433 socklen_t len;
1434 int error = ETIMEDOUT; 1434 int error = ETIMEDOUT;
1435 1435
1436 gaim_debug_misc("socks4 proxy", 1436 gaim_debug_misc("socks4 proxy",
1437 "Connect didn't block.\n"); 1437 "Connect didn't block.\n");
1438 1438
1776 s5_canwrite(gpointer data, gint source, GaimInputCondition cond) 1776 s5_canwrite(gpointer data, gint source, GaimInputCondition cond)
1777 { 1777 {
1778 unsigned char buf[512]; 1778 unsigned char buf[512];
1779 int i; 1779 int i;
1780 struct PHB *phb = data; 1780 struct PHB *phb = data;
1781 unsigned int len; 1781 socklen_t len;
1782 int error = ETIMEDOUT; 1782 int error = ETIMEDOUT;
1783 1783
1784 gaim_debug_info("socks5 proxy", "Connected.\n"); 1784 gaim_debug_info("socks5 proxy", "Connected.\n");
1785 1785
1786 if (phb->inpa > 0) 1786 if (phb->inpa > 0)
1852 close(fd); 1852 close(fd);
1853 return -1; 1853 return -1;
1854 } 1854 }
1855 } 1855 }
1856 else { 1856 else {
1857 unsigned int len; 1857 socklen_t len;
1858 int error = ETIMEDOUT; 1858 int error = ETIMEDOUT;
1859 1859
1860 gaim_debug_misc("socks5 proxy", 1860 gaim_debug_misc("socks5 proxy",
1861 "Connect didn't block.\n"); 1861 "Connect didn't block.\n");
1862 1862