[PATCH obexd 09/13] client: introduce obc_session_cancel

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

 



From: Luiz Augusto von Dentz <luiz.von.dentz@xxxxxxxxx>

---
 client/session.c |   21 +++++++++++++++++++++
 client/session.h |    2 ++
 2 files changed, 23 insertions(+), 0 deletions(-)

diff --git a/client/session.c b/client/session.c
index 44d86f2..f2be457 100644
--- a/client/session.c
+++ b/client/session.c
@@ -1399,3 +1399,24 @@ guint obc_session_delete(struct obc_session *session, const char *file,
 	session->p = p;
 	return p->id;
 }
+
+void obc_session_cancel(struct obc_session *session, guint id,
+							gboolean remove)
+{
+	struct pending_request *p = session->p;
+
+	if (p == NULL || p->id != id)
+		return;
+
+	if (p->req_id == 0)
+		return;
+
+	g_obex_cancel_req(session->obex, p->req_id, remove);
+	if (!remove)
+		return;
+
+	pending_request_free(p);
+	session->p = NULL;
+
+	session_process_queue(session);
+}
diff --git a/client/session.h b/client/session.h
index ac5c27a..008b466 100644
--- a/client/session.h
+++ b/client/session.h
@@ -89,3 +89,5 @@ guint obc_session_move(struct obc_session *session, const char *filename,
 guint obc_session_delete(struct obc_session *session, const char *file,
 				session_callback_t func, void *user_data,
 				GError **err);
+void obc_session_cancel(struct obc_session *session, guint id,
+							gboolean remove);
-- 
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