Linux bluetooth development
 help / color / mirror / Atom feed
From: Slawomir Bochenski <lkslawek@gmail.com>
To: linux-bluetooth@vger.kernel.org
Cc: Slawomir Bochenski <lkslawek@gmail.com>
Subject: [PATCH obexd 1/1] Fix OPP not sending TransferCompleted signal
Date: Fri,  7 Oct 2011 11:11:10 +0200	[thread overview]
Message-ID: <1317978670-24903-2-git-send-email-lkslawek@gmail.com> (raw)
In-Reply-To: <1317978670-24903-1-git-send-email-lkslawek@gmail.com>

Commit 934b3b2f5f8432b67822be9f83a141fe3783cbd7 introduced a regression
in OPP, by making it not send TransferCompleted signal. This happened
because OPP was calling manager_emit_transfer_completed() on .reset(),
and manager_emit_transfer_completed() in turn checks if the os->object
is not NULL. This fixes this by moving clearing os->object after doing
service driver .reset().
---
 src/obex.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/obex.c b/src/obex.c
index 59bbe7a..a0c17c1 100644
--- a/src/obex.c
+++ b/src/obex.c
@@ -288,8 +288,6 @@ static void os_reset_session(struct obex_session *os)
 	if (os->object) {
 		os->driver->set_io_watch(os->object, NULL, NULL);
 		os->driver->close(os->object);
-		os->object = NULL;
-		os->obj = NULL;
 		if (os->aborted && os->cmd == OBEX_CMD_PUT && os->path &&
 				os->driver->remove)
 			os->driver->remove(os->path);
@@ -315,6 +313,8 @@ static void os_reset_session(struct obex_session *os)
 		os->path = NULL;
 	}
 
+	os->object = NULL;
+	os->obj = NULL;
 	os->driver = NULL;
 	os->aborted = FALSE;
 	os->pending = 0;
-- 
1.7.4.1


  reply	other threads:[~2011-10-07  9:11 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-07  9:11 [PATCH obexd 0/1] Fix OPP not sending TransferCompleted signal Slawomir Bochenski
2011-10-07  9:11 ` Slawomir Bochenski [this message]
2011-10-11  9:46   ` [PATCH obexd 1/1] " Luiz Augusto von Dentz
2011-10-11 13:01   ` 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=1317978670-24903-2-git-send-email-lkslawek@gmail.com \
    --to=lkslawek@gmail.com \
    --cc=linux-bluetooth@vger.kernel.org \
    /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