# HG changeset patch # User Christian Hammond # Date 1086555414 0 # Node ID 7a00289f2ef10cd2489a9fb0cce9c4fc99895b71 # Parent 554ef91db2dd811b8fda4336e83ccdbd9b10fa81 [gaim-migrate @ 10022] Some fixes from shx. The progress indicator for file transfers was being reset to 0 after files have been sent, and files were being truncated to 0 bytes. Also, when the file was transfered, the status was being set to "cancel." These are fixed now. committer: Tailor Script diff -r 554ef91db2dd -r 7a00289f2ef1 src/protocols/msn/slp.c --- a/src/protocols/msn/slp.c Sun Jun 06 20:45:53 2004 +0000 +++ b/src/protocols/msn/slp.c Sun Jun 06 20:56:54 2004 +0000 @@ -131,8 +131,8 @@ xfer = slpcall->xfer; - xfer->bytes_sent = offset; - xfer->bytes_remaining = total_length - offset; + xfer->bytes_sent = (offset + len); + xfer->bytes_remaining = total_length - (offset + len); gaim_xfer_update_progress(xfer); } @@ -141,10 +141,13 @@ msn_xfer_finish_cb(MsnSlpCall *slpcall, const char *body, long long size) { - if (size < 0) - gaim_xfer_cancel_remote(slpcall->xfer); - else - gaim_xfer_set_completed(slpcall->xfer, TRUE); + if (gaim_xfer_get_status(slpcall->xfer) != GAIM_XFER_STATUS_DONE) + { + if (size < 0) + gaim_xfer_cancel_remote(slpcall->xfer); + else + gaim_xfer_set_completed(slpcall->xfer, TRUE); + } } /************************************************************************** diff -r 554ef91db2dd -r 7a00289f2ef1 src/protocols/msn/slplink.c --- a/src/protocols/msn/slplink.c Sun Jun 06 20:45:53 2004 +0000 +++ b/src/protocols/msn/slplink.c Sun Jun 06 20:56:54 2004 +0000 @@ -293,11 +293,14 @@ msn_slplink_send_msg(slplink, msg); - if ((slpmsg->slpcall != NULL) && - (slpmsg->slpcall->progress_cb != NULL)) + if (slpmsg->flags == 0x20 || slpmsg->flags == 0x1000030) { - slpmsg->slpcall->progress_cb(slpmsg->slpcall, slpmsg->size, len, - slpmsg->offset); + if ((slpmsg->slpcall != NULL) && + (slpmsg->slpcall->progress_cb != NULL)) + { + slpmsg->slpcall->progress_cb(slpmsg->slpcall, slpmsg->size, len, + slpmsg->offset); + } } slpmsg->offset += len; @@ -467,14 +470,18 @@ if (slpmsg->slpcall != NULL) { - GaimXfer *xfer; + if (slpmsg->flags == 0x20 || slpmsg->flags == 0x1000030) + { + GaimXfer *xfer; - xfer = slpmsg->slpcall->xfer; + xfer = slpmsg->slpcall->xfer; - if (xfer != NULL) - { - slpmsg->fp = - fopen(gaim_xfer_get_local_filename(slpmsg->slpcall->xfer), "wb"); + if (xfer != NULL) + { + slpmsg->fp = + fopen(gaim_xfer_get_local_filename(slpmsg->slpcall->xfer), + "wb"); + } } } }