[Telepathy] FileTransfer: integrating with annoying APIs

mikhail.zabaluev at nokia.com mikhail.zabaluev at nokia.com
Thu Oct 28 00:55:47 PDT 2010


> -----Original Message-----
> From: telepathy-
> bounces+mikhail.zabaluev=nokia.com at lists.freedesktop.org
> [mailto:telepathy-
> bounces+mikhail.zabaluev=nokia.com at lists.freedesktop.org] On Behalf Of
> ext Danielle Madeley
> Sent: Thursday, October 28, 2010 7:32 AM
> To: telepathy at lists.freedesktop.org
> Subject: [Telepathy] FileTransfer: integrating with annoying APIs
> So there are a bunch of File Transfer APIs that we want to integrate
> with (i.e. libpurple) that talk in file names, rather than sockets.
> It turns out to be straight-foward enough to implement receiving with
> such an API, we can receive to a temporary file and then splice the
> contents of that file into a socket back to the client.
> Sending is harder.
> In order to get the client to call ProvideFile we need to ACCEPTED.
> Then
> we need to set state OPEN in order to actually be sent the file, so
> that
> we can then write it into a temporary file and send it.
> The problem here is that we then don't know whether the remote client
> actually accepted the transfer or not.
> I'm proposing we extend the spec with an extra state and extra
> property,
> specifically for sending files: property PrespoolRequired:b and state
> The PrespoolRequired property would indicate that the client should
> call
> ProvideFile() immediately without being concerned about whether the
> channel is pending or not.
> The PRESPOOL state would then indicate that the client should begin
> sending the file (once ProvideFile has been called).
> Once the file is sent to the CM (and the CM can offer the file to the
> remote) the channel would return back to the PENDING state until it is
> accepted. It would then enter the OPEN state and the transfer would
> proceed as normal.

I like this proposal.

Still, using sockets spliced to temporary files as an intermediate step is a bit of a drag, especially if this detail leaks into the API. But I guess the sacred design cows that prevent writing file paths into the spec are still standing.

Best regards,

More information about the telepathy mailing list