aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/libmdsserver/mds-message.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/libmdsserver/mds-message.c b/src/libmdsserver/mds-message.c
index c70bb15..66e8946 100644
--- a/src/libmdsserver/mds-message.c
+++ b/src/libmdsserver/mds-message.c
@@ -426,7 +426,7 @@ size_t mds_message_marshal_size(const mds_message_t* restrict this)
for (i = 0; i < this->header_count; i++)
rc += strlen(this->headers[i]);
rc *= sizeof(char);
- rc += 4 * sizeof(size_t) + 1 * sizeof(int);
+ rc += 4 * sizeof(size_t) + 2 * sizeof(int);
return rc;
}
@@ -483,6 +483,7 @@ int mds_message_unmarshal(mds_message_t* restrict this, char* restrict data)
buf_get_next(data, size_t, this->payload_size);
buf_get_next(data, size_t, this->payload_ptr);
buf_get_next(data, size_t, this->buffer_size = this->buffer_ptr);
+ buf_get_next(data, int, this->stage);
/* Make sure that the pointers are NULL so that they are
not freed without being allocated when the message is
@@ -491,8 +492,6 @@ int mds_message_unmarshal(mds_message_t* restrict this, char* restrict data)
this->payload = NULL;
this->buffer = NULL;
- buf_get_next(data, int, this->stage);
-
/* To 2-power-multiple of 128 bytes. */
this->buffer_size >>= 7;
if (this->buffer_size == 0)