diff --git a/src/utils/proto.c b/src/utils/proto.c
index f8265d6861da71335da53a88d3c932b713c718e6..61676266ead9cc14a49049cc85a5f5dbe1a96031 100644 (file)
--- a/src/utils/proto.c
+++ b/src/utils/proto.c
return -1;
len = OBJ_HEADER_LEN + strlen(metric->hostname) + strlen(metric->name) + 2;
return -1;
len = OBJ_HEADER_LEN + strlen(metric->hostname) + strlen(metric->name) + 2;
- if (metric->store_type && metric->store_id)
+ if (metric->store_type && metric->store_id) {
len += strlen(metric->store_type) + strlen(metric->store_id) + 2;
len += strlen(metric->store_type) + strlen(metric->store_id) + 2;
+ if (metric->store_last_update > 0)
+ len += sizeof(sdb_time_t);
+ }
if (buf_len < len)
return len;
if (buf_len < len)
return len;
if (metric->store_type && metric->store_id) {
n = marshal_string(buf, buf_len, metric->store_type);
buf += n; buf_len -= n;
if (metric->store_type && metric->store_id) {
n = marshal_string(buf, buf_len, metric->store_type);
buf += n; buf_len -= n;
- marshal_string(buf, buf_len, metric->store_id);
+ n = marshal_string(buf, buf_len, metric->store_id);
+ buf += n; buf_len -= n;
+ if (metric->store_last_update > 0) {
+ n = marshal_datetime(buf, buf_len, metric->store_last_update);
+ buf += n; buf_len -= n;
+ }
}
return len;
} /* sdb_proto_marshal_metric */
}
return len;
} /* sdb_proto_marshal_metric */
buf += n; len -= n; l += n;
if ((n = unmarshal_string(buf, len, metric ? &metric->name : NULL)) < 0)
return n;
buf += n; len -= n; l += n;
if ((n = unmarshal_string(buf, len, metric ? &metric->name : NULL)) < 0)
return n;
+
+ metric->store_last_update = 0;
if (len > (size_t)n) {
buf += n; len -= n; l += n;
if ((n = unmarshal_string(buf, len,
if (len > (size_t)n) {
buf += n; len -= n; l += n;
if ((n = unmarshal_string(buf, len,
if ((n = unmarshal_string(buf, len,
metric ? &metric->store_id : NULL)) < 0)
return n;
if ((n = unmarshal_string(buf, len,
metric ? &metric->store_id : NULL)) < 0)
return n;
+ if (len >= sizeof(sdb_time_t)) {
+ buf += n; len -= n; l += n;
+ if ((n = unmarshal_datetime(buf, len,
+ metric ? &metric->store_last_update : NULL)) < 0)
+ return n;
+ }
}
else if (metric) {
metric->store_type = NULL;
}
else if (metric) {
metric->store_type = NULL;