diff options
Diffstat (limited to 'src/libmdsserver')
-rw-r--r-- | src/libmdsserver/mds-message.c | 1 | ||||
-rw-r--r-- | src/libmdsserver/util.c | 4 |
2 files changed, 3 insertions, 2 deletions
diff --git a/src/libmdsserver/mds-message.c b/src/libmdsserver/mds-message.c index b324ad4..d65ac6b 100644 --- a/src/libmdsserver/mds-message.c +++ b/src/libmdsserver/mds-message.c @@ -94,6 +94,7 @@ int mds_message_read(mds_message_t* restrict this, int fd) { size_t i; xfree(this->headers, this->header_count); + this->headers = NULL; } this->header_count = 0; diff --git a/src/libmdsserver/util.c b/src/libmdsserver/util.c index 07f4bfa..b909876 100644 --- a/src/libmdsserver/util.c +++ b/src/libmdsserver/util.c @@ -126,7 +126,7 @@ size_t send_message(int socket, const char* message, size_t length) ssize_t just_sent; while (length > 0) - if ((just_sent = send(socket, message, min(block_size, length), MSG_NOSIGNAL)) < 0) + if ((just_sent = send(socket, message + sent, min(block_size, length), MSG_NOSIGNAL)) < 0) { if (errno == EMSGSIZE) { @@ -139,7 +139,7 @@ size_t send_message(int socket, const char* message, size_t length) } else { - message += (size_t)just_sent; + sent += (size_t)just_sent; length -= (size_t)just_sent; } |