bug in libpurple/ft.c

Mark Doliner mark at kingant.net
Sun Jan 25 14:55:12 EST 2009


2009/1/25 Sulabh Mahajan <sulabh.dev at gmail.com>:
> I have been trying to complete a certain part of p2p file transfers for
> yahoo protocol for long time. When we receive file, it always used to get
> stuck just after the file has been completely transfered. I noticed that the
> cause might be in libpurple rather than the code in yahoo.
>
> Please let me know if I am wrong here, or if this could be done through the
> protocol code without touching libpurple.
>
> in libpurple/ft.c, in the function purple_xfer_read(), when the if condition
> "xfer->ops.read != NULL" holds true, even after completely reading the file,
> the function purple_xfer_set_completed() isnt called. This results in the
> transfer being stuck after the file is completely obtained.

It looks like jabber and yahoo are the only protocols that call
purple_xfer_set_read_fnc(), and jabber only uses a custom read
function for reading headers, and set the read function to NULL once
the headers have been read.  So I think you could make the change you
would suggest and it wouldn't cause any problems.

Does it make sense to make that change?  Yes, I think so.  It may have
been written the way it is so that prpls could have more control over
when the file transfer is marked as "completed."  But since nothing is
actually using it then I think it makes sense to make the code
simpler.

So I say go for it.

-Mark




More information about the Devel mailing list