From a64765498f64627825c609cb080a1c9fffea5698 Mon Sep 17 00:00:00 2001 From: Mikel Astiz Date: Wed, 7 Mar 2012 15:50:29 +0100 Subject: [PATCH] obexd: simplify obc_session_pull 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. --- obexd/client/session.c | 22 +--------------------- 1 file changed, 1 insertion(+), 21 deletions(-) diff --git a/obexd/client/session.c b/obexd/client/session.c index e13042714..a9883c7ab 100644 --- a/obexd/client/session.c +++ b/obexd/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); } -- 2.47.3