Code

utils/proto: Replaced sdb_proto_send_msg with sdb_proto_marshal.
[sysdb.git] / src / client / sock.c
index 533e9e31b62c16457f36ae1e844a450251c26c51..eaa10ffdb95307a31c0233d10d46b68f33d7f912 100644 (file)
@@ -248,10 +248,14 @@ ssize_t
 sdb_client_send(sdb_client_t *client,
                uint32_t cmd, uint32_t msg_len, const char *msg)
 {
+       char buf[2 * sizeof(uint32_t) + msg_len];
+
        if ((! client) || (! client->fd))
                return -1;
+       if (sdb_proto_marshal(buf, sizeof(buf), cmd, msg_len, msg) < 0)
+               return -1;
 
-       return sdb_proto_send_msg(client->fd, cmd, msg_len, msg);
+       return sdb_proto_send(client->fd, sizeof(buf), buf);
 } /* sdb_client_send */
 
 ssize_t