[Bug 32434] FileTransfer: add a way to pass the outgoing file to the Handler
bugzilla-daemon at freedesktop.org
bugzilla-daemon at freedesktop.org
Tue Jan 25 11:10:19 CET 2011
https://bugs.freedesktop.org/show_bug.cgi?id=32434
--- Comment #3 from Will Thompson <will.thompson at collabora.co.uk> 2011-01-25 02:10:15 PST ---
So you're proposing:
prop LocalFilePath (rw):
tp:requestable
tp:immutable='sometimes'
For outgoing file transfers, this requestable property allows the channel
requester to inform observers (and the handler, if it is not the requester
itself) of the full path to the local file being transferred. Note that the
connection manager SHOULD NOT read this local file directly; the handler
streams the file into the CM through the socket negotiated using ProvideFile.
On outgoing file transfers, this property MUST NOT change after the channel
is requested.
tp:rationale
Historically, the handler for outgoing file transfers had to be the
same process as the requester: there was no way for the requester to tell the
handler which file should be sent. This made it impossible to write
tp_send_file (TpContact *foo, const gchar *file_path) without reimplementing
the user interface for file transfers.
For incoming file transfers, this property MAY be set by the channel
handler before calling AcceptFile to inform observers where the incoming file
will be saved locally. Setting this property once AcceptFile has been called
MUST fail. Blah blah observers should check this property's value when
FileTransferStateChanged(Open) is emitted.
There's a race:
• Handler sets LocalFileURI
• Handler calls AcceptFile(); CM returns really quickly, and emits
FileTransferStateChanged(Open)
• Observer calls Get(LocalFileURI), but due to a quirk of the scheduler the
message doesn't get sent for a while.
• Handler gets the entire file.
• CM emits FileTransferStateChanged(Completed)
• Handler calls Close()
• The observer's method call finally gets delivered, and fails.
So I think we need change notification. LocalFileURISet(s: Local_File_URI)
doesn't seem so bad.
--
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.
More information about the telepathy-bugs
mailing list