Hi, > -----Original Message----- > From: telepathy- > [email protected] > [mailto:telepathy- > [email protected]] On Behalf Of > ext Danielle Madeley > Sent: Thursday, October 28, 2010 7:32 AM > To: [email protected] > 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 > 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.
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, Mikhail _______________________________________________ telepathy mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/telepathy
