Mercurial > pidgin
diff libpurple/ft.c @ 26167:4cbe258db067
fix a bug in libpurple that prevented receiving file transfers to be marked completed (in case the protocol uses an xfer->ops.read function)
| author | Sulabh Mahajan <sulabh@soc.pidgin.im> |
|---|---|
| date | Wed, 28 Jan 2009 07:34:18 +0000 |
| parents | 568b786c36f9 |
| children | 0c796a1950b7 |
line wrap: on
line diff
--- a/libpurple/ft.c Wed Jan 28 07:01:37 2009 +0000 +++ b/libpurple/ft.c Wed Jan 28 07:34:18 2009 +0000 @@ -857,8 +857,12 @@ else s = MIN(purple_xfer_get_bytes_remaining(xfer), xfer->current_buffer_size); - if (xfer->ops.read != NULL) + if (xfer->ops.read != NULL) { r = (xfer->ops.read)(buffer, xfer); + if ((purple_xfer_get_size(xfer) > 0) && + ((purple_xfer_get_bytes_sent(xfer)+r) >= purple_xfer_get_size(xfer))) + purple_xfer_set_completed(xfer, TRUE); + } else { *buffer = g_malloc0(s);
