[PROTO] Fix missing return ID and binary_ack count
authorDmitry Bogatov <d.bogatov@samsung.com>
Wed, 16 Oct 2013 05:46:37 +0000 (09:46 +0400)
committerGerrit Code Review <gerrit@gerrit.vlan144.tizendev.org>
Wed, 16 Oct 2013 15:14:32 +0000 (15:14 +0000)
Change-Id: I6ec8f0e5c5fde30b0bfaaacf31e0a218b6649adc
Signed-off-by: Dmitry Bogatov <d.bogatov@samsung.com>
daemon/da_protocol.c

index 44325545ed8ac6d08fab9a914fd75db88dda35cd..94f6f519dd1bf86bd46bc8c338c2cc7f97a1584e 100644 (file)
@@ -884,7 +884,7 @@ static int process_msg_binary_info(struct msg_buf_t *msg)
                return -1;
        }
 
-       struct binary_ackacks[bincount];
+       struct binary_ack *acks[bincount];
        size_t total_size = 0;
        for (i = 0; i != bincount; ++i) {
                const char *str = parse_string_inplace(msg);
@@ -895,12 +895,20 @@ static int process_msg_binary_info(struct msg_buf_t *msg)
                acks[i] = binary_ack_alloc(str);
                total_size += binary_ack_size(acks[i]);
        }
-
-       struct msg_t* msg_reply = malloc(8 + total_size);
+       typedef uint32_t return_id;
+       typedef uint32_t binary_ack_count;
+       struct msg_t *msg_reply = malloc(sizeof(struct msg_t)
+                                        + sizeof(return_id)
+                                        + sizeof(binary_ack_count)
+                                        + total_size);
        char *p = msg_reply->payload;
 
        msg_reply->id = NMSG_BINARY_INFO_ACK;
-       msg_reply->len = total_size;
+       msg_reply->len = total_size + sizeof(return_id)
+                                   + sizeof(binary_ack_count);
+
+       pack_int32(p, ERR_NO);
+       pack_int32(p, bincount);
 
        for (i = 0; i != bincount; ++i) {
                p += binary_ack_pack(p, acks[i]);