* [PATCH 0/2] Fix regression on suspend on opening
@ 2010-10-14 12:35 Dmitriy Paliy
0 siblings, 0 replies; 5+ messages in thread
From: Dmitriy Paliy @ 2010-10-14 12:35 UTC (permalink / raw)
To: linux-bluetooth
Hi,
This fixes regression when doing suspend on opening obex stream. If
obex_write_stream returns length of buffer, it is treated as error
reponse, which is not correct.
A typo is fixed in comments as well.
Br,
Dmitriy
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 0/2] Fix regression on suspend on opening
@ 2010-10-15 6:57 Dmitriy Paliy
2010-10-15 6:57 ` [PATCH 1/2] " Dmitriy Paliy
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: Dmitriy Paliy @ 2010-10-15 6:57 UTC (permalink / raw)
To: linux-bluetooth
Hi,
This fixes regression when doing suspend on opening obex stream. If
obex_write_stream returns length of buffer, it is treated as an error
response later on, which is not correct.
Negative values returned by obex_write_stream are error codes, while
positive ones mean length of buffer. Positive values are never used
afterwards in the code. Therefore, due to this reason, and for being
compliant with obex_read_stream, which also returns 0 only, it was
decided to remove return of positive value representing length at all.
Result of such is also some code cleanup that removes unnecessary return
len when it is zero.
A typo is fixed in comments as well.
Br,
Dmitriy
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 1/2] Fix regression on suspend on opening
2010-10-15 6:57 [PATCH 0/2] Fix regression on suspend on opening Dmitriy Paliy
@ 2010-10-15 6:57 ` Dmitriy Paliy
2010-10-15 6:57 ` [PATCH 2/2] Code cleanup: unnecessary operation and typo removed Dmitriy Paliy
2010-10-15 7:21 ` [PATCH 0/2] Fix regression on suspend on opening Johan Hedberg
2 siblings, 0 replies; 5+ messages in thread
From: Dmitriy Paliy @ 2010-10-15 6:57 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Dmitriy Paliy
This fixes regression on suspend on opening when obex_write_stream
returns length of buffer, which is treated as error response
afterwards.
---
src/obex.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/src/obex.c b/src/obex.c
index d1ac339..4e1db9c 100644
--- a/src/obex.c
+++ b/src/obex.c
@@ -683,7 +683,7 @@ add_header:
os->offset += len;
- return len;
+ return 0;
}
static gboolean handle_async_io(void *object, int flags, int err,
--
1.7.0.4
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH 2/2] Code cleanup: unnecessary operation and typo removed
2010-10-15 6:57 [PATCH 0/2] Fix regression on suspend on opening Dmitriy Paliy
2010-10-15 6:57 ` [PATCH 1/2] " Dmitriy Paliy
@ 2010-10-15 6:57 ` Dmitriy Paliy
2010-10-15 7:21 ` [PATCH 0/2] Fix regression on suspend on opening Johan Hedberg
2 siblings, 0 replies; 5+ messages in thread
From: Dmitriy Paliy @ 2010-10-15 6:57 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Dmitriy Paliy
Code cleanup: unnecessary operation 'return len;' removed and typo in
comments immidiately to immediately corrected.
---
src/obex.c | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/src/obex.c b/src/obex.c
index 4e1db9c..adfcc95 100644
--- a/src/obex.c
+++ b/src/obex.c
@@ -678,7 +678,6 @@ add_header:
if (len == 0) {
g_free(os->buf);
os->buf = NULL;
- return len;
}
os->offset += len;
@@ -818,7 +817,7 @@ static void cmd_get(struct obex_session *os, obex_t *obex, obex_object_t *obj)
OBEX_ObjectAddHeader (obex, obj, OBEX_HDR_BODY,
hd, 0, OBEX_FL_STREAM_START);
- /* Try to write to stream and suspend the stream immidiately
+ /* Try to write to stream and suspend the stream immediately
* if no data available to send. */
err = obex_write_stream(os, obex, obj);
if (err == -EAGAIN) {
--
1.7.0.4
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH 0/2] Fix regression on suspend on opening
2010-10-15 6:57 [PATCH 0/2] Fix regression on suspend on opening Dmitriy Paliy
2010-10-15 6:57 ` [PATCH 1/2] " Dmitriy Paliy
2010-10-15 6:57 ` [PATCH 2/2] Code cleanup: unnecessary operation and typo removed Dmitriy Paliy
@ 2010-10-15 7:21 ` Johan Hedberg
2 siblings, 0 replies; 5+ messages in thread
From: Johan Hedberg @ 2010-10-15 7:21 UTC (permalink / raw)
To: Dmitriy Paliy; +Cc: linux-bluetooth
Hi Dmitriy,
On Fri, Oct 15, 2010, Dmitriy Paliy wrote:
> This fixes regression when doing suspend on opening obex stream. If
> obex_write_stream returns length of buffer, it is treated as an error
> response later on, which is not correct.
>
> Negative values returned by obex_write_stream are error codes, while
> positive ones mean length of buffer. Positive values are never used
> afterwards in the code. Therefore, due to this reason, and for being
> compliant with obex_read_stream, which also returns 0 only, it was
> decided to remove return of positive value representing length at all.
>
> Result of such is also some code cleanup that removes unnecessary return
> len when it is zero.
>
> A typo is fixed in comments as well.
Both patches have been pushed upstream. Thanks. Btw, don't be afraid to
put this kind of explanations in the commit messages themselves since
that info is easier to find in a couple of years time than this cover
letter email.
Johan
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2010-10-15 7:21 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-10-15 6:57 [PATCH 0/2] Fix regression on suspend on opening Dmitriy Paliy
2010-10-15 6:57 ` [PATCH 1/2] " Dmitriy Paliy
2010-10-15 6:57 ` [PATCH 2/2] Code cleanup: unnecessary operation and typo removed Dmitriy Paliy
2010-10-15 7:21 ` [PATCH 0/2] Fix regression on suspend on opening Johan Hedberg
-- strict thread matches above, loose matches on Subject: below --
2010-10-14 12:35 Dmitriy Paliy
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).