Mercurial > pidgin
diff src/ft.c @ 13786:5ddde4ad1ca2
[gaim-migrate @ 16198]
Fix some places where a closed socket isn't being dealt with correctly. This may be the cause of the high CPU usage that some people have noticed.
Most of these were reported by Eduardo Prez.
committer: Tailor Script <tailor@pidgin.im>
author | Daniel Atallah <daniel.atallah@gmail.com> |
---|---|
date | Fri, 26 May 2006 03:26:03 +0000 |
parents | 4b6308145fcd |
children | 9af607a0108f |
line wrap: on
line diff
--- a/src/ft.c Wed May 24 17:38:42 2006 +0000 +++ b/src/ft.c Fri May 26 03:26:03 2006 +0000 @@ -794,6 +794,8 @@ else if ((gaim_xfer_get_size(xfer) > 0) && ((gaim_xfer_get_bytes_sent(xfer)+r) >= gaim_xfer_get_size(xfer))) gaim_xfer_set_completed(xfer, TRUE); + else if (r == 0) + r = -1; } return r; @@ -835,7 +837,7 @@ r = gaim_xfer_read(xfer, &buffer); if (r > 0) { fwrite(buffer, 1, r, xfer->dest_fp); - } else if(r < 0) { + } else if(r <= 0) { gaim_xfer_cancel_remote(xfer); return; }