linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mikel Astiz <mikel.astiz.oss@gmail.com>
To: linux-bluetooth@vger.kernel.org
Cc: Mikel Astiz <mikel.astiz@bmw-carit.de>
Subject: [PATCH obexd v2 2/2] client: free active transfer on session shutdown
Date: Tue, 28 Feb 2012 13:56:22 +0100	[thread overview]
Message-ID: <1330433782-23492-2-git-send-email-mikel.astiz.oss@gmail.com> (raw)
In-Reply-To: <1330433782-23492-1-git-send-email-mikel.astiz.oss@gmail.com>

From: Mikel Astiz <mikel.astiz@bmw-carit.de>

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


  reply	other threads:[~2012-02-28 12:56 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-28 12:56 [PATCH obexd v2 1/2] client: fix unreported canceled transfers Mikel Astiz
2012-02-28 12:56 ` Mikel Astiz [this message]
2012-02-28 13:06   ` [PATCH obexd v2 2/2] client: free active transfer on session shutdown Luiz Augusto von Dentz
2012-02-28 13:05 ` [PATCH obexd v2 1/2] client: fix unreported canceled transfers Luiz Augusto von Dentz
2012-03-01  1:47 ` Johan Hedberg

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=1330433782-23492-2-git-send-email-mikel.astiz.oss@gmail.com \
    --to=mikel.astiz.oss@gmail.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;
as well as URLs for NNTP newsgroup(s).