comparison src/ft.c @ 13107:d65fa65eac02

[gaim-migrate @ 15469] I "inadvertently" caused file transfers to not finish in the core - this fixes it. committer: Tailor Script <tailor@pidgin.im>
author Daniel Atallah <daniel.atallah@gmail.com>
date Fri, 03 Feb 2006 01:23:46 +0000
parents 5e14039d0415
children 8695e933ad64
comparison
equal deleted inserted replaced
13106:a0a4b44239e8 13107:d65fa65eac02
853 /* We have to seek back in the file now. */ 853 /* We have to seek back in the file now. */
854 fseek(xfer->dest_fp, r - s, SEEK_CUR); 854 fseek(xfer->dest_fp, r - s, SEEK_CUR);
855 } 855 }
856 } 856 }
857 857
858 if (gaim_xfer_get_size(xfer) > 0) 858 if (r > 0) {
859 xfer->bytes_remaining -= r; 859 if (gaim_xfer_get_size(xfer) > 0)
860 860 xfer->bytes_remaining -= r;
861 xfer->bytes_sent += r; 861
862 862 xfer->bytes_sent += r;
863 if (xfer->ops.ack != NULL) 863
864 xfer->ops.ack(xfer, buffer, r); 864 if (xfer->ops.ack != NULL)
865 865 xfer->ops.ack(xfer, buffer, r);
866 g_free(buffer); 866
867 867 g_free(buffer);
868 ui_ops = gaim_xfer_get_ui_ops(xfer); 868
869 869 ui_ops = gaim_xfer_get_ui_ops(xfer);
870 if (ui_ops != NULL && ui_ops->update_progress != NULL) 870
871 ui_ops->update_progress(xfer, gaim_xfer_get_progress(xfer)); 871 if (ui_ops != NULL && ui_ops->update_progress != NULL)
872 ui_ops->update_progress(xfer,
873 gaim_xfer_get_progress(xfer));
874 }
872 875
873 if (gaim_xfer_is_completed(xfer)) 876 if (gaim_xfer_is_completed(xfer))
874 gaim_xfer_end(xfer); 877 gaim_xfer_end(xfer);
875 } 878 }
876 879