Linux bluetooth development
 help / color / mirror / Atom feed
From: Jaganath <jaganath.k@samsung.com>
To: Mikel Astiz <mikel.astiz@bmw-carit.de>
Cc: linux-bluetooth@vger.kernel.org
Subject: Re: [PATCH obexd] client: Fix ABORT command not sending when user cancels the transfer
Date: Mon, 20 Feb 2012 19:32:40 +0530	[thread overview]
Message-ID: <B158FCB4A4AD46BA8FB575BE936597AA@sisodomain.com> (raw)
In-Reply-To: <4F4248B9.6090700@bmw-carit.de>

Hi Mikel,

--------------------------------------------------
From: "Mikel Astiz" <mikel.astiz@bmw-carit.de>
Sent: Monday, February 20, 2012 6:50 PM
To: "Jaganath Kanakkassery" <jaganath.k@samsung.com>
Cc: <linux-bluetooth@vger.kernel.org>
Subject: Re: [PATCH obexd] client: Fix ABORT command not sending when user 
cancels the transfer

> Hi Jaganath,
>
>> Issue: When user cancels the tranfer, after queuing the ABORT command
>> transfer->callback() with error will be called. In that session_unref
>> is called which disconnects the transport.
>>
>> Fix: Just send ABORT command during abort and transfer->callback()
>> will be called after getting response of ABORT command.
>> ---
>>   client/transfer.c      |   12 ------------
>>   gobex/gobex-transfer.c |    6 +++++-
>>   2 files changed, 5 insertions(+), 13 deletions(-)
>>
>> diff --git a/client/transfer.c b/client/transfer.c
>> index 157811d..88e8ef7 100644
>> --- a/client/transfer.c
>> +++ b/client/transfer.c
>> @@ -141,23 +141,11 @@ static DBusMessage 
>> *obc_transfer_get_properties(DBusConnection *connection,
>>
>>   static void obc_transfer_abort(struct obc_transfer *transfer)
>>   {
>> - struct transfer_callback *callback = transfer->callback;
>> -
>>   if (transfer->xfer == 0)
>>   return;
>>
>>   g_obex_cancel_transfer(transfer->xfer);
>>   transfer->xfer = 0;
>> -
>> - if (callback) {
>> - GError *err;
>> -
>> - err = g_error_new(OBC_TRANSFER_ERROR, -ECANCELED, "%s",
>> - strerror(ECANCELED));
>> - callback->func(transfer, transfer->transferred, err,
>> - callback->data);
>> - g_error_free(err);
>> - }
>>   }
>>
>
> I think this callback is needed here, particularly for transfers that are 
> queued but have not been started yet. This does not work right now

For queued transfer also reqid will be non zero. So in case if it is not
pending request response callback will be called in cancel_complete()
which is invoked in g_obex_cancel_req()

> but I was planning to propose a patch series to fix it soon. Also, IMO it 
> seems fair to report the abortion as soon as possible to the upper layers, 
> no matter what the response will be.
>
> Having said that, I agree that transfer canceling is broken right now.
>
> Cheers,
> Mikel
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" 
> in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html 


  reply	other threads:[~2012-02-20 14:02 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-20 12:49 [PATCH obexd] client: Fix ABORT command not sending when user cancels the transfer Jaganath Kanakkassery
2012-02-20 13:20 ` Mikel Astiz
2012-02-20 14:02   ` Jaganath [this message]
2012-02-20 13:23 ` Luiz Augusto von Dentz
2012-02-20 13:55   ` Jaganath

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=B158FCB4A4AD46BA8FB575BE936597AA@sisodomain.com \
    --to=jaganath.k@samsung.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