* [PATCH obexd 0/1] Fix OPP not sending TransferCompleted signal @ 2011-10-07 9:11 Slawomir Bochenski 2011-10-07 9:11 ` [PATCH obexd 1/1] " Slawomir Bochenski 0 siblings, 1 reply; 4+ messages in thread From: Slawomir Bochenski @ 2011-10-07 9:11 UTC (permalink / raw) To: linux-bluetooth; +Cc: Slawomir Bochenski The following is kind of a lazy fix. Share your view on dealing with that. I'd guess that more appropriate fix would be to remove the "os->object != NULL" check from manager_emit_transfer_completed() and instead make a simple session object in OPP being single gboolean or even use user_data pointer directly as a boolean indicator to let the opp_reset() know whether or not obex_put_stream_start() was successful. Btw shouldn't we also do manager_emit_transfer_started() in opp_get()? ^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH obexd 1/1] Fix OPP not sending TransferCompleted signal 2011-10-07 9:11 [PATCH obexd 0/1] Fix OPP not sending TransferCompleted signal Slawomir Bochenski @ 2011-10-07 9:11 ` Slawomir Bochenski 2011-10-11 9:46 ` Luiz Augusto von Dentz 2011-10-11 13:01 ` Johan Hedberg 0 siblings, 2 replies; 4+ messages in thread From: Slawomir Bochenski @ 2011-10-07 9:11 UTC (permalink / raw) To: linux-bluetooth; +Cc: Slawomir Bochenski 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 ^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH obexd 1/1] Fix OPP not sending TransferCompleted signal 2011-10-07 9:11 ` [PATCH obexd 1/1] " Slawomir Bochenski @ 2011-10-11 9:46 ` Luiz Augusto von Dentz 2011-10-11 13:01 ` Johan Hedberg 1 sibling, 0 replies; 4+ messages in thread From: Luiz Augusto von Dentz @ 2011-10-11 9:46 UTC (permalink / raw) To: Slawomir Bochenski; +Cc: linux-bluetooth Hi Slawomir, On Fri, Oct 7, 2011 at 12:11 PM, Slawomir Bochenski <lkslawek@gmail.com> wrote: > 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 Ack. -- Luiz Augusto von Dentz ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH obexd 1/1] Fix OPP not sending TransferCompleted signal 2011-10-07 9:11 ` [PATCH obexd 1/1] " Slawomir Bochenski 2011-10-11 9:46 ` Luiz Augusto von Dentz @ 2011-10-11 13:01 ` Johan Hedberg 1 sibling, 0 replies; 4+ messages in thread From: Johan Hedberg @ 2011-10-11 13:01 UTC (permalink / raw) To: Slawomir Bochenski; +Cc: linux-bluetooth Hi Slawek, On Fri, Oct 07, 2011, Slawomir Bochenski wrote: > 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(-) Applied. Thanks. Johan ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2011-10-11 13:01 UTC | newest] Thread overview: 4+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2011-10-07 9:11 [PATCH obexd 0/1] Fix OPP not sending TransferCompleted signal Slawomir Bochenski 2011-10-07 9:11 ` [PATCH obexd 1/1] " Slawomir Bochenski 2011-10-11 9:46 ` Luiz Augusto von Dentz 2011-10-11 13:01 ` Johan Hedberg
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox