aboutsummaryrefslogtreecommitdiffstats
path: root/src/mds-server/interception_condition.c
diff options
context:
space:
mode:
authorMattias Andrée <maandree@operamail.com>2014-05-19 01:49:53 +0200
committerMattias Andrée <maandree@operamail.com>2014-05-19 01:49:58 +0200
commit198e8ee15037d1de39a3d23d3bf579fed0561ba3 (patch)
tree05739bf7d251f1af6c1c9110cb98201c10bf7848 /src/mds-server/interception_condition.c
parentDo not just queue "Client close" message, but also send it (diff)
downloadmds-198e8ee15037d1de39a3d23d3bf579fed0561ba3.tar.gz
mds-198e8ee15037d1de39a3d23d3bf579fed0561ba3.tar.bz2
mds-198e8ee15037d1de39a3d23d3bf579fed0561ba3.tar.xz
store structure version for all structures when marshalling
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to '')
-rw-r--r--src/mds-server/interception_condition.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/mds-server/interception_condition.c b/src/mds-server/interception_condition.c
index 47a082a..8f11adb 100644
--- a/src/mds-server/interception_condition.c
+++ b/src/mds-server/interception_condition.c
@@ -32,7 +32,7 @@
*/
size_t interception_condition_marshal_size(const interception_condition_t* restrict this)
{
- return sizeof(size_t) + sizeof(int64_t) + sizeof(int) + (strlen(this->condition) + 1) * sizeof(char);
+ return sizeof(size_t) + sizeof(int64_t) + 2 * sizeof(int) + (strlen(this->condition) + 1) * sizeof(char);
}
/**
@@ -44,12 +44,13 @@ size_t interception_condition_marshal_size(const interception_condition_t* restr
*/
size_t interception_condition_marshal(const interception_condition_t* restrict this, char* restrict data)
{
- size_t n = (strlen(this->condition) + 1) * sizeof(char);;
+ size_t n = (strlen(this->condition) + 1) * sizeof(char);
+ buf_set_next(data, int, INTERCEPTION_CONDITION_T_VERSION);
buf_set_next(data, size_t, this->header_hash);
buf_set_next(data, int64_t, this->priority);
buf_set_next(data, int, this->modifying);
memcpy(data, this->condition, n);
- return sizeof(size_t) + sizeof(int64_t) + sizeof(int) + n;
+ return sizeof(size_t) + sizeof(int64_t) + 2 * sizeof(int) + n;
}
@@ -64,6 +65,8 @@ size_t interception_condition_unmarshal(interception_condition_t* restrict this,
{
size_t n;
this->condition = NULL;
+ /* buf_get_next(data, int, INTERCEPTION_CONDITION_T_VERSION); */
+ buf_next(data, int, 1);
buf_get_next(data, size_t, this->header_hash);
buf_get_next(data, int64_t, this->priority);
buf_get_next(data, int, this->modifying);
@@ -84,6 +87,7 @@ size_t interception_condition_unmarshal(interception_condition_t* restrict this,
size_t interception_condition_unmarshal_skip(char* restrict data)
{
size_t n = sizeof(size_t) + sizeof(int64_t) + sizeof(int);
+ buf_next(data, int, 1);
buf_next(data, size_t, 1);
buf_next(data, int64_t, 1);
buf_next(data, int, 1);