From: Sebastian Harl Date: Mon, 15 Dec 2014 09:46:25 +0000 (+0100) Subject: connection: Use sdb_proto_unmarshal_header. X-Git-Tag: sysdb-0.7.0~106 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=62bcef8f27358d680dc2b6c0abee051b3f9d4a98;p=sysdb.git connection: Use sdb_proto_unmarshal_header. --- diff --git a/src/frontend/connection.c b/src/frontend/connection.c index 58a2cb4..09f906c 100644 --- a/src/frontend/connection.c +++ b/src/frontend/connection.c @@ -358,9 +358,8 @@ command_init(sdb_conn_t *conn) /* reset */ sdb_strbuf_clear(conn->errbuf); - conn->cmd = sdb_proto_get_int(conn->buf, 0); - conn->cmd_len = sdb_proto_get_int(conn->buf, sizeof(uint32_t)); - + if (sdb_proto_unmarshal_header(conn->buf, &conn->cmd, &conn->cmd_len)) + return -1; sdb_strbuf_skip(conn->buf, 0, 2 * sizeof(uint32_t)); if ((! conn->ready) && (conn->cmd != SDB_CONNECTION_STARTUP))