From ed6baf1417a1cf108a5d52f5d22b919f501adf67 Mon Sep 17 00:00:00 2001 From: Luiz Augusto von Dentz Date: Fri, 27 Sep 2013 14:21:36 +0300 Subject: [PATCH] obexd/client: Fix not setting Transfer.Size for GET operations GET operations may return the length header in the first response which should be set as transfer Size property. --- obexd/client/transfer.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/obexd/client/transfer.c b/obexd/client/transfer.c index 2e8f7c76c..99a17e9f7 100644 --- a/obexd/client/transfer.c +++ b/obexd/client/transfer.c @@ -603,6 +603,17 @@ static void get_xfer_progress_first(GObex *obex, GError *err, GObexPacket *rsp, return; } + hdr = g_obex_packet_get_header(rsp, G_OBEX_HDR_LENGTH); + if (hdr) { + uint32_t len; + if (g_obex_header_get_uint32(hdr, &len)) { + transfer->size = len; + g_dbus_emit_property_changed(transfer->conn, + transfer->path, + TRANSFER_INTERFACE, "Size"); + } + } + hdr = g_obex_packet_get_header(rsp, G_OBEX_HDR_APPARAM); if (hdr) { apparam = g_obex_header_get_apparam(hdr);