summaryrefslogtreecommitdiff
path: root/obexd
diff options
context:
space:
mode:
authorLuiz Augusto von Dentz <luiz.von.dentz@intel.com>2013-09-27 14:21:36 +0300
committerLuiz Augusto von Dentz <luiz.von.dentz@intel.com>2013-09-29 17:01:07 +0300
commited6baf1417a1cf108a5d52f5d22b919f501adf67 (patch)
treee28e6118eac27fe3d4fc4172db9b042a791a5fd8 /obexd
parentdf65753b0a8a2cafe887fdd038282805396259ce (diff)
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.
Diffstat (limited to 'obexd')
-rw-r--r--obexd/client/transfer.c11
1 files changed, 11 insertions, 0 deletions
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);