Mercurial > pidgin.yaz
comparison src/protocols/qq/udp_proxy_s5.c @ 14045:3cefea0bf4a2
[gaim-migrate @ 16657]
Took care of some signedness issues.
committer: Tailor Script <tailor@pidgin.im>
author | Mark Huetsch <markhuetsch> |
---|---|
date | Sun, 06 Aug 2006 21:03:10 +0000 |
parents | ef8490f9e823 |
children | 8ea1929c4c69 |
comparison
equal
deleted
inserted
replaced
14044:16b05033f5ee | 14045:3cefea0bf4a2 |
---|---|
31 static void _qq_s5_canread_again(gpointer data, gint source, GaimInputCondition cond) | 31 static void _qq_s5_canread_again(gpointer data, gint source, GaimInputCondition cond) |
32 { | 32 { |
33 unsigned char buf[512]; | 33 unsigned char buf[512]; |
34 struct PHB *phb = data; | 34 struct PHB *phb = data; |
35 struct sockaddr_in sin; | 35 struct sockaddr_in sin; |
36 int len; | 36 int len, error; |
37 | 37 |
38 gaim_input_remove(phb->inpa); | 38 gaim_input_remove(phb->inpa); |
39 gaim_debug(GAIM_DEBUG_INFO, "socks5 proxy", "Able to read again.\n"); | 39 gaim_debug(GAIM_DEBUG_INFO, "socks5 proxy", "Able to read again.\n"); |
40 | 40 |
41 len = read(source, buf, 10); | 41 len = read(source, buf, 10); |
80 g_free(phb->host); | 80 g_free(phb->host); |
81 g_free(phb); | 81 g_free(phb); |
82 return; | 82 return; |
83 } | 83 } |
84 | 84 |
85 int error = ETIMEDOUT; | 85 error = ETIMEDOUT; |
86 gaim_debug(GAIM_DEBUG_INFO, "QQ", "Connect didn't block\n"); | 86 gaim_debug(GAIM_DEBUG_INFO, "QQ", "Connect didn't block\n"); |
87 len = sizeof(error); | 87 len = sizeof(error); |
88 if (getsockopt(phb->udpsock, SOL_SOCKET, SO_ERROR, &error, &len) < 0) { | 88 if (getsockopt(phb->udpsock, SOL_SOCKET, SO_ERROR, &error, &len) < 0) { |
89 gaim_debug(GAIM_DEBUG_ERROR, "QQ", "getsockopt failed.\n"); | 89 gaim_debug(GAIM_DEBUG_ERROR, "QQ", "getsockopt failed.\n"); |
90 close(phb->udpsock); | 90 close(phb->udpsock); |
207 } | 207 } |
208 | 208 |
209 static void _qq_s5_canread(gpointer data, gint source, GaimInputCondition cond) | 209 static void _qq_s5_canread(gpointer data, gint source, GaimInputCondition cond) |
210 { | 210 { |
211 unsigned char buf[512]; | 211 unsigned char buf[512]; |
212 struct PHB *phb = data; | 212 struct PHB *phb; |
213 int ret; | |
214 | |
215 phb = data; | |
213 | 216 |
214 gaim_input_remove(phb->inpa); | 217 gaim_input_remove(phb->inpa); |
215 gaim_debug(GAIM_DEBUG_INFO, "socks5 proxy", "Able to read.\n"); | 218 gaim_debug(GAIM_DEBUG_INFO, "socks5 proxy", "Able to read.\n"); |
216 | 219 |
217 int ret = read(source, buf, 2); | 220 ret = read(source, buf, 2); |
218 if (ret < 2) { | 221 if (ret < 2) { |
219 gaim_debug(GAIM_DEBUG_INFO, "s5_canread", "packet smaller than 2 octet\n"); | 222 gaim_debug(GAIM_DEBUG_INFO, "s5_canread", "packet smaller than 2 octet\n"); |
220 close(source); | 223 close(source); |
221 | 224 |
222 if (phb->account == NULL || gaim_account_get_connection(phb->account) != NULL) { | 225 if (phb->account == NULL || gaim_account_get_connection(phb->account) != NULL) { |
273 gaim_debug(GAIM_DEBUG_INFO, "s5_canread", "calling s5_sendconnect\n"); | 276 gaim_debug(GAIM_DEBUG_INFO, "s5_canread", "calling s5_sendconnect\n"); |
274 _qq_s5_sendconnect(phb, source); | 277 _qq_s5_sendconnect(phb, source); |
275 } | 278 } |
276 } | 279 } |
277 | 280 |
278 void _qq_s5_canwrite(gpointer data, gint source, GaimInputCondition cond) | 281 static void _qq_s5_canwrite(gpointer data, gint source, GaimInputCondition cond) |
279 { | 282 { |
280 unsigned char buf[512]; | 283 unsigned char buf[512]; |
281 int i; | 284 int i; |
282 struct PHB *phb = data; | 285 struct PHB *phb = data; |
283 unsigned int len; | 286 unsigned int len; |