aboutsummaryrefslogtreecommitdiffstats
path: root/src/libmdsserver
diff options
context:
space:
mode:
authorMattias Andrée <maandree@operamail.com>2014-06-07 06:44:05 +0200
committerMattias Andrée <maandree@operamail.com>2014-06-07 06:44:05 +0200
commitee7375ca896d478964b9fbc2b6589a44405a8737 (patch)
tree8664d36f4158fe6309a4099b35f442721096130c /src/libmdsserver
parentfix some client marshalling errors (diff)
downloadmds-ee7375ca896d478964b9fbc2b6589a44405a8737.tar.gz
mds-ee7375ca896d478964b9fbc2b6589a44405a8737.tar.bz2
mds-ee7375ca896d478964b9fbc2b6589a44405a8737.tar.xz
fix message marshal error
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to '')
-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)