Return-Path: MIME-Version: 1.0 In-Reply-To: <1330433782-23492-2-git-send-email-mikel.astiz.oss@gmail.com> References: <1330433782-23492-1-git-send-email-mikel.astiz.oss@gmail.com> <1330433782-23492-2-git-send-email-mikel.astiz.oss@gmail.com> Date: Tue, 28 Feb 2012 15:06:41 +0200 Message-ID: Subject: Re: [PATCH obexd v2 2/2] client: free active transfer on session shutdown From: Luiz Augusto von Dentz To: Mikel Astiz Cc: linux-bluetooth@vger.kernel.org, Mikel Astiz Content-Type: text/plain; charset=ISO-8859-1 Sender: linux-bluetooth-owner@vger.kernel.org List-ID: Hi Mikel, On Tue, Feb 28, 2012 at 2:56 PM, Mikel Astiz wrote: > From: Mikel Astiz > > The currently active request should be canceled just like any other > queued transfer. Otherwise obex timeout is reported. > --- > ?client/session.c | ? ?8 ++++++++ > ?1 files changed, 8 insertions(+), 0 deletions(-) > > diff --git a/client/session.c b/client/session.c > index c4645fb..42eba10 100644 > --- a/client/session.c > +++ b/client/session.c > @@ -496,6 +496,14 @@ void obc_session_shutdown(struct obc_session *session) > ? ? ? ?err = g_error_new(OBEX_IO_ERROR, OBEX_IO_DISCONNECTED, > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?"Session closed by user"); > > + ? ? ? if (session->p != NULL) { > + ? ? ? ? ? ? ? if (session->p->func) > + ? ? ? ? ? ? ? ? ? ? ? session->p->func(session, err, session->p->data); > + > + ? ? ? ? ? ? ? pending_request_free(session->p); > + ? ? ? ? ? ? ? session->p = NULL; > + ? ? ? } > + > ? ? ? ?while ((p = g_queue_pop_head(session->queue))) { > ? ? ? ? ? ? ? ?if (p->func) > ? ? ? ? ? ? ? ? ? ? ? ?p->func(session, err, p->data); > -- > 1.7.6.5 Ack. -- Luiz Augusto von Dentz