OSDN Git Service
(root)
/
android-x86
/
external-bluetooth-bluez.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
ba377e0
)
gobex: Fix end of body packets for on-demand headers
author
Johan Hedberg
<johan.hedberg@intel.com>
Tue, 5 Jul 2011 15:29:55 +0000
(18:29 +0300)
committer
Marcel Holtmann
<marcel@holtmann.org>
Tue, 4 Dec 2012 21:21:59 +0000
(22:21 +0100)
gobex/gobex-packet.c
patch
|
blob
|
history
diff --git
a/gobex/gobex-packet.c
b/gobex/gobex-packet.c
index
16d4b7a
..
e5bf618
100644
(file)
--- a/
gobex/gobex-packet.c
+++ b/
gobex/gobex-packet.c
@@
-290,6
+290,15
@@
gssize g_obex_packet_encode(GObexPacket *pkt, guint8 *buf, gsize len)
if (ret < 0)
return ret;
+ /* Fix-up on-demand body header type and final bit. This
+ * breaks the layers of abstraction a bit but it's the
+ * simplest way to avoid two consecutive empty packets */
+ if (g_obex_header_get_id(hdr) == G_OBEX_HDR_ID_BODY &&
+ ret == 3) {
+ buf[0] |= FINAL_BIT;
+ buf[count] = G_OBEX_HDR_ID_BODY_END;
+ }
+
count += ret;
}