# HG changeset patch # User Paul Aurich # Date 1262035191 0 # Node ID 24b341ae63f7f8cedf414a4f0ed4899c58c3cbff # Parent ac6c2dda0eae74483b7898b954f9e6c40af45b06 msn: Use the PurpleXfer size if available. This fixes file transfers not being detected as complete when there is no file on the system (the receiving end isn't able to tell how much data to expect). diff -r ac6c2dda0eae -r 24b341ae63f7 libpurple/protocols/msn/slplink.c --- a/libpurple/protocols/msn/slplink.c Wed Dec 23 07:47:14 2009 +0000 +++ b/libpurple/protocols/msn/slplink.c Mon Dec 28 21:19:51 2009 +0000 @@ -669,7 +669,7 @@ #define MAX_FILE_NAME_LEN 0x226 static gchar * -gen_context(const char *file_name, const char *file_path) +gen_context(PurpleXfer *xfer, const char *file_name, const char *file_path) { struct stat st; gsize size = 0; @@ -683,7 +683,10 @@ glong uni_len = 0; gsize len; - if (g_stat(file_path, &st) == 0) + if (xfer) + size = purple_xfer_get_size(xfer); + + if (size == 0 && g_stat(file_path, &st) == 0) size = st.st_size; if(!file_name) { @@ -761,7 +764,7 @@ xfer->data = slpcall; - context = gen_context(fn, fp); + context = gen_context(xfer, fn, fp); msn_slpcall_invite(slpcall, MSN_FT_GUID, 2, context);