pidgin: 0caff498: msn: Use the PurpleXfer size if availabl...
darkrain42 at pidgin.im
darkrain42 at pidgin.im
Mon Dec 28 16:25:40 EST 2009
-----------------------------------------------------------------
Revision: 0caff498282376143dafe8a090cdcd2b3235ef4a
Ancestor: 8f0a3e68547fbc66188357edbf6694bd8dd2d557
Author: darkrain42 at pidgin.im
Date: 2009-12-28T21:19:51
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/0caff498282376143dafe8a090cdcd2b3235ef4a
Modified files:
libpurple/protocols/msn/slplink.c
ChangeLog:
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).
-------------- next part --------------
============================================================
--- libpurple/protocols/msn/slplink.c 63df86157e7562765317ad7d941bfe91675444c6
+++ libpurple/protocols/msn/slplink.c 2f7a0cb081768c7b07ccb6d4a8a54de2cb979c58
@@ -669,7 +669,7 @@ static gchar *
#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 @@ gen_context(const char *file_name, const
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 @@ msn_slplink_request_ft(MsnSlpLink *slpli
xfer->data = slpcall;
- context = gen_context(fn, fp);
+ context = gen_context(xfer, fn, fp);
msn_slpcall_invite(slpcall, MSN_FT_GUID, 2, context);
More information about the Commits
mailing list