OSDN Git Service

gobex: Fix also response code for on-demand data based packets
authorJohan Hedberg <johan.hedberg@intel.com>
Tue, 5 Jul 2011 21:49:09 +0000 (00:49 +0300)
committerMarcel Holtmann <marcel@holtmann.org>
Tue, 4 Dec 2012 21:21:59 +0000 (22:21 +0100)
gobex/gobex-packet.c

index b316553..0e6528e 100644 (file)
@@ -336,8 +336,12 @@ gssize g_obex_packet_encode(GObexPacket *pkt, guint8 *buf, gsize len)
                ret = get_body(pkt, buf + count, len - count);
                if (ret < 0)
                        return ret;
-               if (ret == 0)
+               if (ret == 0) {
+                       if (pkt->opcode == G_OBEX_RSP_CONTINUE)
+                               buf[0] = G_OBEX_RSP_SUCCESS;
                        buf[0] |= FINAL_BIT;
+               }
+
                count += ret + 3;
        }