X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=src%2Ffrontend%2Fstore.c;h=ff563165cb1bf7ebda020c1ac2f630e13990e571;hb=23b12088ee320df7b54f5c81011daf8995e22203;hp=5f3ce846ec16865790874fb90018a3f4c5916ea3;hpb=af24300b64d721ec7e3be3edee1477d83b135f8b;p=sysdb.git diff --git a/src/frontend/store.c b/src/frontend/store.c index 5f3ce84..ff56316 100644 --- a/src/frontend/store.c +++ b/src/frontend/store.c @@ -92,7 +92,6 @@ sdb_fe_store(sdb_conn_t *conn) "STORE: Invalid command length %zu", len); return -1; } - buf += n; len -= n; switch (type) { case SDB_HOST: @@ -125,16 +124,18 @@ sdb_fe_store(sdb_conn_t *conn) } return sdb_fe_store_metric(conn, &metric); } - case SDB_ATTRIBUTE: - { - sdb_proto_attribute_t attr; - if (sdb_proto_unmarshal_attribute(buf, len, &attr) < 0) { - sdb_strbuf_sprintf(conn->errbuf, - "STORE: Failed to unmarshal attribute object"); - return -1; - } - return sdb_fe_store_attribute(conn, &attr); + } + if (type & SDB_ATTRIBUTE) { + sdb_proto_attribute_t attr; + int status; + if (sdb_proto_unmarshal_attribute(buf, len, &attr) < 0) { + sdb_strbuf_sprintf(conn->errbuf, + "STORE: Failed to unmarshal attribute object"); + return -1; } + status = sdb_fe_store_attribute(conn, &attr); + sdb_data_free_datum(&attr.value); + return status; } sdb_log(SDB_LOG_ERR, "frontend: Invalid object type %d for "