[Telepathy] FileTransfer: integrating with annoying APIs

Danielle Madeley danielle.madeley at collabora.co.uk
Wed Oct 27 21:32:01 PDT 2010


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
PRESPOOL.

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.

--danni

-- 
Danielle Madeley
Software Developer, Collabora Ltd.                  Melbourne, Australia

www.collabora.co.uk



More information about the telepathy mailing list