From d4f18457a4bcdf321b6f97394c3a7c26dd2225e7 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Wed, 14 May 2014 06:41:32 +0200 Subject: fix dumb-client and memory errors MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- src/mds-server/mds-server.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/mds-server') diff --git a/src/mds-server/mds-server.c b/src/mds-server/mds-server.c index aebd104..c0e4ea0 100644 --- a/src/mds-server/mds-server.c +++ b/src/mds-server/mds-server.c @@ -617,7 +617,7 @@ void* slave_loop(void* data) break; } n -= sent; - sendbuf_ += sent; + sendbuf_ += sent / sizeof(char); } free(sendbuf); ); @@ -936,7 +936,7 @@ int message_received(client_t* client) free(msgbuf); return 0; } - queue_message_multicast(msgbuf, n, client); + queue_message_multicast(msgbuf_, n, client); /* Queue message to be sent when this function returns. This done to simplify `multicast_message` for re-exec. */ @@ -1346,6 +1346,7 @@ void multicast_message(multicast_t* multicast) /* Send the message. */ with_mutex(client->mutex, errno = 0; + n *= sizeof(char); if (client->open) while (n > 0) { @@ -1357,7 +1358,7 @@ void multicast_message(multicast_t* multicast) break; } n -= sent; - multicast->message_ptr += sent; + multicast->message_ptr += sent / sizeof(char); } ); -- cgit v1.2.3-70-g09d2