[PATCH obexd v3 13/14] client: Make FileTransfer.PutFile asynchronous

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Mikel Astiz <mikel.astiz@xxxxxxxxxxxx>

There is no reason to have inconsistent behavior between GetFile and
PutFile, in FileTransfer D-Bus API.

Before this change, PutFile reported success immediately after queueing
the transfer, even though the D-Bus signature includes the async flag.
---
 client/ftp.c |   13 ++++++++-----
 1 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/client/ftp.c b/client/ftp.c
index 9b2c51d..8c72413 100644
--- a/client/ftp.c
+++ b/client/ftp.c
@@ -143,7 +143,7 @@ static const GMarkupParser parser = {
 	NULL
 };
 
-static void get_file_callback(struct obc_session *session,
+static void transfer_callback(struct obc_session *session,
 						struct obc_transfer *transfer,
 						GError *err, void *user_data)
 {
@@ -270,8 +270,8 @@ static DBusMessage *get_file(DBusConnection *connection,
 	if (transfer == NULL)
 		goto fail;
 
-	if (obc_session_queue(session, transfer, get_file_callback, message,
-								&err)) {
+	if (obc_session_queue(session, transfer, transfer_callback, message,
+									&err)) {
 		dbus_message_ref(message);
 		return NULL;
 	}
@@ -306,8 +306,11 @@ static DBusMessage *put_file(DBusConnection *connection,
 	if (transfer == NULL)
 		goto fail;
 
-	if (obc_session_queue(session, transfer, NULL, NULL, &err))
-		return dbus_message_new_method_return(message);
+	if (obc_session_queue(session, transfer, transfer_callback, message,
+									&err)) {
+		dbus_message_ref(message);
+		return NULL;
+	}
 
 fail:
 	reply = g_dbus_create_error(message, "org.openobex.Error.Failed", "%s",
-- 
1.7.7.6

--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux