Re: [PATCH obexd] client: fix unreported canceled transfers

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

 



Hi Mikel,

On Mon, Feb 27, 2012 at 4:14 PM, Mikel Astiz <mikel.astiz.oss@xxxxxxxxx> wrote:
> From: Mikel Astiz <mikel.astiz@xxxxxxxxxxxx>
>
> A session can be shutted down from D-Bus, and therefore the pending
> transfer callbacks must be reported.
> ---
>  client/session.c  |   15 ++++++++++++++-
>  client/transfer.c |    4 +---
>  client/transfer.h |    3 +++
>  3 files changed, 18 insertions(+), 4 deletions(-)
>
> diff --git a/client/session.c b/client/session.c
> index 417295e..f5740ce 100644
> --- a/client/session.c
> +++ b/client/session.c
> @@ -485,12 +485,25 @@ proceed:
>
>  void obc_session_shutdown(struct obc_session *session)
>  {
> +       struct pending_request *p;
> +       GError *err;
> +
>        DBG("%p", session);
>
>        obc_session_ref(session);
>
>        /* Unregister any pending transfer */
> -       g_queue_foreach(session->queue, (GFunc) pending_request_free, NULL);
> +       err = g_error_new(OBC_TRANSFER_ERROR, -ECANCELED, "%s",
> +                                                       strerror(ECANCELED));

I would use a specific error for this, OBEX_IO_DISCONNECTED or
something like that belongs to session. Btw, session->p should also be
cancelled as well.


-- 
Luiz Augusto von Dentz
--
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