[PATCH obexd v2 4/4] client: simplify obc_session_pull

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

 



From: Mikel Astiz <mikel.astiz@xxxxxxxxxxxx>

Functions obc_session_get and obc_session_pull nearly share the same
code, so the later can be achieved by just calling the first one.

The session api is not modified in this patch.
---
 client/session.c |   22 +---------------------
 1 files changed, 1 insertions(+), 21 deletions(-)

diff --git a/client/session.c b/client/session.c
index e130427..a9883c7 100644
--- a/client/session.c
+++ b/client/session.c
@@ -1005,27 +1005,7 @@ int obc_session_pull(struct obc_session *session,
 				const char *type, const char *targetfile,
 				session_callback_t function, void *user_data)
 {
-	struct obc_transfer *transfer;
-	const char *agent;
-
-	if (session->obex == NULL)
-		return -ENOTCONN;
-
-	if (session->agent != NULL)
-		agent = obc_agent_get_name(session->agent);
-	else
-		agent = NULL;
-
-	transfer = obc_transfer_register(session->conn, session->obex,
-								agent,
-								targetfile,
-								NULL, type,
-								NULL);
-	if (transfer == NULL) {
-		return -EIO;
-	}
-
-	return session_request(session, transfer, session_prepare_get,
+	return obc_session_get(session, type, NULL, targetfile, NULL, 0,
 							function, user_data);
 }
 
-- 
1.7.6.5

--
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