Re: [PATCH obexd v2 7/8] client: fix canceling queued transfers

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

Hi Mikel.

--------------------------------------------------
From: "Jaganath" <jaganath.k@xxxxxxxxxxx>
Sent: Wednesday, February 22, 2012 5:11 PM
To: "Mikel Astiz" <mikel.astiz.oss@xxxxxxxxx>; <linux-bluetooth@xxxxxxxxxxxxxxx>
Cc: "Mikel Astiz" <mikel.astiz@xxxxxxxxxxxx>
Subject: Re: [PATCH obexd v2 7/8] client: fix canceling queued transfers

Hi Mikel,

--------------------------------------------------
From: "Mikel Astiz" <mikel.astiz.oss@xxxxxxxxx>
Sent: Tuesday, February 21, 2012 7:27 PM
To: <linux-bluetooth@xxxxxxxxxxxxxxx>
Cc: "Mikel Astiz" <mikel.astiz@xxxxxxxxxxxx>
Subject: [PATCH obexd v2 7/8] client: fix canceling queued transfers

From: Mikel Astiz <mikel.astiz@xxxxxxxxxxxx>

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 b470a3a..dea9a2a 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 transfer->obex is unrefed here then the queued ABORT packet will not be sent. This will create problem with PTS which requires ABORT command before transport disconnection

Sorry. I think my comment is invalid since refcount will not be zero in this case.



 if (callback) {
 GError *err;
--
1.7.6.5

--


Regards
Jaganath

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

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

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


[Bluez Devel]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]    [Yosemite Photos]    [Free Online Dating]     [Bluez Devel]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Devices]     [Big List of Linux Books]

Add to Google Powered by Linux