* [PATCH 0/1] Fix suspend stream on opening if no data @ 2010-10-13 12:20 Dmitriy Paliy 2010-10-13 12:20 ` [PATCH] " Dmitriy Paliy 0 siblings, 1 reply; 4+ messages in thread From: Dmitriy Paliy @ 2010-10-13 12:20 UTC (permalink / raw) To: linux-bluetooth Hi, This patch is to suspend obex stream on opening if there is no data available yet to be sent. In such way unnecessary trafic is avoided and IOP is improved with certain headsets. More specifically call histories get requests from BH-902 are fixed. Br, Dmitriy ^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH] Fix suspend stream on opening if no data 2010-10-13 12:20 [PATCH 0/1] Fix suspend stream on opening if no data Dmitriy Paliy @ 2010-10-13 12:20 ` Dmitriy Paliy 2010-10-13 12:24 ` Bastien Nocera 2010-10-13 12:30 ` Johan Hedberg 0 siblings, 2 replies; 4+ messages in thread From: Dmitriy Paliy @ 2010-10-13 12:20 UTC (permalink / raw) To: linux-bluetooth; +Cc: Dmitriy Paliy Fix write to stream and suspend it immidiately if there is no data available. --- src/obex.c | 14 +++++++++++++- 1 files changed, 13 insertions(+), 1 deletions(-) diff --git a/src/obex.c b/src/obex.c index c7d0753..71bcba8 100644 --- a/src/obex.c +++ b/src/obex.c @@ -813,10 +813,22 @@ static void cmd_get(struct obex_session *os, obex_t *obex, obex_object_t *obj) os->obj = obj; os->driver->set_io_watch(os->object, handle_async_io, os); return; - } else + } else { /* Standard data stream */ OBEX_ObjectAddHeader (obex, obj, OBEX_HDR_BODY, hd, 0, OBEX_FL_STREAM_START); + + /* Try to write to stream and suspend the stream immidiately + * if no data available to send. */ + err = obex_write_stream(os, obex, obj); + if (err == -EAGAIN) { + OBEX_SuspendRequest(obex, obj); + os->obj = obj; + os->driver->set_io_watch(os->object, handle_async_io, + os); + return; + } + } done: os_set_response(obj, err); -- 1.7.0.4 ^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] Fix suspend stream on opening if no data 2010-10-13 12:20 ` [PATCH] " Dmitriy Paliy @ 2010-10-13 12:24 ` Bastien Nocera 2010-10-13 12:30 ` Johan Hedberg 1 sibling, 0 replies; 4+ messages in thread From: Bastien Nocera @ 2010-10-13 12:24 UTC (permalink / raw) To: Dmitriy Paliy; +Cc: linux-bluetooth On Wed, 2010-10-13 at 15:20 +0300, Dmitriy Paliy wrote: > + /* Try to write to stream and suspend the stream > immidiately Should be immediately (and in the log message as well) ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] Fix suspend stream on opening if no data 2010-10-13 12:20 ` [PATCH] " Dmitriy Paliy 2010-10-13 12:24 ` Bastien Nocera @ 2010-10-13 12:30 ` Johan Hedberg 1 sibling, 0 replies; 4+ messages in thread From: Johan Hedberg @ 2010-10-13 12:30 UTC (permalink / raw) To: Dmitriy Paliy; +Cc: linux-bluetooth Hi Dmitriy, On Wed, Oct 13, 2010, Dmitriy Paliy wrote: > Fix write to stream and suspend it immidiately if there is no data > available. > --- > src/obex.c | 14 +++++++++++++- > 1 files changed, 13 insertions(+), 1 deletions(-) Looks good. The patch has been pushed upstream. Do pay attention to whitespace issues in the future though. I got this when applying it: Applying: Fix suspend stream on opening if no data /home/jh/src/obexd/.git/rebase-apply/patch:18: trailing whitespace. warning: 1 line applied after fixing whitespace errors. This came from the empty line with two tabs after the AddHeader call: > OBEX_ObjectAddHeader (obex, obj, OBEX_HDR_BODY, > hd, 0, OBEX_FL_STREAM_START); > + Johan ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2010-10-13 12:30 UTC | newest] Thread overview: 4+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2010-10-13 12:20 [PATCH 0/1] Fix suspend stream on opening if no data Dmitriy Paliy 2010-10-13 12:20 ` [PATCH] " Dmitriy Paliy 2010-10-13 12:24 ` Bastien Nocera 2010-10-13 12:30 ` Johan Hedberg
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox