Linux bluetooth development
 help / color / mirror / Atom feed
From: Jaganath <jaganath.k@samsung.com>
To: Luiz Augusto von Dentz <luiz.dentz@gmail.com>
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:25:05 +0530	[thread overview]
Message-ID: <D5966BC142C34C93B808CF99839A204A@sisodomain.com> (raw)
In-Reply-To: <CABBYNZLNPeRkTbyoJ7a82SmVehmvTosTDqX0zjy_-eZRMS=ALA@mail.gmail.com>

Hi Luiz.

--------------------------------------------------
From: "Luiz Augusto von Dentz" <luiz.dentz@gmail.com>
Sent: Monday, February 20, 2012 6:53 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,
>
> On Mon, Feb 20, 2012 at 2:49 PM, Jaganath Kanakkassery
> <jaganath.k@samsung.com> wrote:
>> 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.
>
> I don't get the issue, you don't want to disconnect immediately if the
> transfer aborts and the last reference is released? IMO that is fine
> in most of the cases, btw by disconnecting it also serves as an ABORT.
User perspective this is fine but PTS requires ABORT command before
transport disconnection
> The only cases where we would not do it is if the session object is
> created, e.g. ftp, but if that happens than the module is responsible
> to hold a reference to the session preventing it to disconnect.
>
>> diff --git a/gobex/gobex-transfer.c b/gobex/gobex-transfer.c
>> index c62a91e..706952f 100644
>> --- a/gobex/gobex-transfer.c
>> +++ b/gobex/gobex-transfer.c
>> @@ -635,6 +635,10 @@ gboolean g_obex_cancel_transfer(guint id)
>>        if (transfer == NULL)
>>                return FALSE;
>>
>> -       transfer_free(transfer);
>> +       if (transfer->req_id > 0)
>> +               g_obex_cancel_req(transfer->obex, transfer->req_id, 
>> FALSE);
>> +       else
>> +               transfer_free(transfer);
>> +
>>        return TRUE;
>>  }
>
> Btw, when you changing gobex please send its changes separately
> starting with gobex:, so not that after g_obex_cancel_transfer the id
> and callback should no longer be accessible so the application should
> be able to free its resources, so if we call the callback latter it
> will very likely cause a crash.
I don't get you. In g_obex_cancel_transfer() it just sends abort command.
Transfer will be freed in transfer_complete().
>
> -- 
> Luiz Augusto von Dentz 


      reply	other threads:[~2012-02-20 13:55 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
2012-02-20 13:23 ` Luiz Augusto von Dentz
2012-02-20 13:55   ` Jaganath [this message]

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=D5966BC142C34C93B808CF99839A204A@sisodomain.com \
    --to=jaganath.k@samsung.com \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=luiz.dentz@gmail.com \
    /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