From: Mikel Astiz <mikel.astiz.oss@gmail.com>
To: linux-bluetooth@vger.kernel.org
Cc: Mikel Astiz <mikel.astiz@bmw-carit.de>
Subject: [PATCH obexd v3 2/2] client: fix canceling queued transfers
Date: Mon, 27 Feb 2012 10:54:36 +0100 [thread overview]
Message-ID: <1330336476-13454-3-git-send-email-mikel.astiz.oss@gmail.com> (raw)
In-Reply-To: <1330336476-13454-1-git-send-email-mikel.astiz.oss@gmail.com>
From: Mikel Astiz <mikel.astiz@bmw-carit.de>
The Cancel() method in the D-Bus api should also abort queued transfers,
which should just be removed from the queue.
---
client/transfer.c | 12 ++++++++----
1 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/client/transfer.c b/client/transfer.c
index dded02f..d1edef2 100644
--- a/client/transfer.c
+++ b/client/transfer.c
@@ -143,11 +143,15 @@ static void obc_transfer_abort(struct obc_transfer *transfer)
{
struct transfer_callback *callback = transfer->callback;
- if (transfer->xfer == 0)
- return;
+ if (transfer->xfer > 0) {
+ g_obex_cancel_transfer(transfer->xfer);
+ transfer->xfer = 0;
+ }
- g_obex_cancel_transfer(transfer->xfer);
- transfer->xfer = 0;
+ if (transfer->obex != NULL) {
+ g_obex_unref(transfer->obex);
+ transfer->obex = NULL;
+ }
if (callback) {
GError *err;
--
1.7.6.5
next prev parent reply other threads:[~2012-02-27 9:54 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-02-27 9:54 [PATCH obexd v3 0/2] Transfer cancelation Mikel Astiz
2012-02-27 9:54 ` [PATCH obexd v3 1/2] client: terminate queued transfers properly Mikel Astiz
2012-02-27 9:54 ` Mikel Astiz [this message]
2012-02-27 10:40 ` [PATCH obexd v3 0/2] Transfer cancelation Johan Hedberg
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1330336476-13454-3-git-send-email-mikel.astiz.oss@gmail.com \
--to=mikel.astiz.oss@gmail.com \
--cc=linux-bluetooth@vger.kernel.org \
--cc=mikel.astiz@bmw-carit.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).