obexd: 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.
This commit is contained in:
Mikel Astiz 2012-06-12 14:10:24 +02:00 committed by Marcel Holtmann
parent a9a5fcd7db
commit 68b394a78b

View File

@ -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",