pidgin: 9d51cb9f: Fix up some cases of file transfers neve...

Stu Tomlinson stu at nosnilmot.com
Tue Nov 8 16:43:47 EST 2011


On Sat, 2011-03-05 at 22:05 -0500, rekkanoryo at pidgin.im wrote: 

Yes, really, I'm following up 8 months later than I should...

> ----------------------------------------------------------------------
> Revision: 9d51cb9fbcc04d21597eed0381f4d06c53facc44
> Parent:   17326b88b85d2f13939a71ca80d4a617f0527f9a
> Author:   Cristi Posoiu
> Date:     03/05/11 21:55:31
> Branch:   im.pidgin.pidgin
> URL: http://d.pidgin.im/viewmtn/revision/info/9d51cb9fbcc04d21597eed0381f4d06c53facc44
> 
> Changelog: 
> 
> Fix up some cases of file transfers never finishing.  This will help certain
> instances of Yahoo file transfers not working, but not all.  Fixes #12472.
> 
> Changes against parent 17326b88b85d2f13939a71ca80d4a617f0527f9a
> 
>   patched  libpurple/ft.c
> 
> ============================================================
> --- libpurple/ft.c	2b8633b159e16099b858dd21ed122e9c3811a9d5
> +++ libpurple/ft.c	ffba61c0a50c9d5f866f8b1f0dec16cf13bbd65c
> @@ -1100,9 +1100,11 @@ purple_xfer_write(PurpleXfer *xfer, cons
>  		r = write(xfer->fd, buffer, s);
>  		if (r < 0 && errno == EAGAIN)
>  			r = 0;
> -		if ((purple_xfer_get_bytes_sent(xfer)+r) >= purple_xfer_get_size(xfer))
> -			purple_xfer_set_completed(xfer, TRUE);
>  	}
> +	if (r >= 0 && (purple_xfer_get_bytes_sent(xfer)+r) >= purple_xfer_get_size(xfer) &&
> +		!purple_xfer_is_completed(xfer))
> +		purple_xfer_set_completed(xfer, TRUE);
> +	
>  
>  	return r;
>  }

I think this breaks stuff. prpls that provide their own FT ops expect to
handle setting xfer completion status themselves, which is why this was
conditional on xfer->ops.write == NULL before, and I suspect causes
those prpls to potentially crash when the xfer is marked as completed
externally. (I saw a BT in a Fedora bug report too long ago that made me
come to this conclusion but I've lost it).

This affects people using MSN with MSNP set to 15 so that FT & buddy
icons still work (aka Fedora users). I think it would be better to keep
this behavior (allow prpls that specify FT ops to have full control over
when xfers complete) and I suggest the better fix for Yahoo FT is to fix
the Yahoo prpl to handle whatever cases were broken before.

Regards,


Stu. 




More information about the Devel mailing list