Mercurial > pidgin.yaz
comparison src/protocols/oscar/rxqueue.c @ 2808:e79f30457998
[gaim-migrate @ 2821]
plug it in, plug it in
committer: Tailor Script <tailor@pidgin.im>
author | Eric Warmenhoven <eric@warmenhoven.org> |
---|---|
date | Wed, 28 Nov 2001 05:30:13 +0000 |
parents | e841b14b5b89 |
children | 10a2d4d5bcf2 |
comparison
equal
deleted
inserted
replaced
2807:f01e6a425136 | 2808:e79f30457998 |
---|---|
22 | 22 |
23 for (cur = 0, left = count; left; ) { | 23 for (cur = 0, left = count; left; ) { |
24 int ret; | 24 int ret; |
25 | 25 |
26 ret = recv(fd, ((unsigned char *)buf)+cur, left, 0); | 26 ret = recv(fd, ((unsigned char *)buf)+cur, left, 0); |
27 if (ret == -1) | 27 |
28 /* Of course EOF is an error, only morons disagree with that. */ | |
29 if (ret <= 0) | |
28 return -1; | 30 return -1; |
29 else if (ret == 0) | |
30 return cur; | |
31 | 31 |
32 cur += ret; | 32 cur += ret; |
33 left -= ret; | 33 left -= ret; |
34 } | 34 } |
35 | 35 |
394 /* | 394 /* |
395 * This shouldn't happen unless the socket breaks, the server breaks, | 395 * This shouldn't happen unless the socket breaks, the server breaks, |
396 * or we break. We must handle it just in case. | 396 * or we break. We must handle it just in case. |
397 */ | 397 */ |
398 if (aimbs_get8(&flaphdr) != 0x2a) { | 398 if (aimbs_get8(&flaphdr) != 0x2a) { |
399 faimdprintf(sess, 0, "FLAP framing disrupted"); | 399 fu8_t start; |
400 | |
401 aim_bstream_rewind(&flaphdr); | |
402 start = aimbs_get8(&flaphdr); | |
403 faimdprintf(sess, 0, "FLAP framing disrupted (0x%02x)", start); | |
400 aim_conn_close(conn); | 404 aim_conn_close(conn); |
401 return -1; | 405 return -1; |
402 } | 406 } |
403 | 407 |
404 /* allocate a new struct */ | 408 /* allocate a new struct */ |