diff options
author | Mikel Astiz <mikel.astiz@bmw-carit.de> | 2012-06-12 14:10:24 +0200 |
---|---|---|
committer | Luiz Augusto von Dentz <luiz.von.dentz@intel.com> | 2012-06-12 17:29:34 +0300 |
commit | dc673a864c797ebecaac1a09e6f1dac98cbb1ad0 (patch) | |
tree | eb5f24313898f53efb3bbf6ae2080d3a486ec822 | |
parent | e2a71b0cca80b23d07a104afb5ef7f976974643a (diff) | |
download | obexd-dc673a864c797ebecaac1a09e6f1dac98cbb1ad0.tar.gz |
client: Fix possible unreplied D-Bus message
If a previous cancel request is in progress, a second cancel request
should fail.
This by the way fixes unreplied D-Bus messages.
-rw-r--r-- | client/transfer.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/client/transfer.c b/client/transfer.c index 242d989..0686afe 100644 --- a/client/transfer.c +++ b/client/transfer.c @@ -213,6 +213,11 @@ static DBusMessage *obc_transfer_cancel(DBusConnection *connection, ERROR_INTERFACE ".NotAuthorized", "Not Authorized"); + if (transfer->msg != NULL) + return g_dbus_create_error(message, + ERROR_INTERFACE ".InProgress", + "Cancellation already in progress"); + if (!obc_transfer_abort(transfer)) return g_dbus_create_error(message, ERROR_INTERFACE ".Failed", |