diff options
Diffstat (limited to 'src/mds-server/sending.c')
-rw-r--r-- | src/mds-server/sending.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/mds-server/sending.c b/src/mds-server/sending.c index 98bb26f..3b78e54 100644 --- a/src/mds-server/sending.c +++ b/src/mds-server/sending.c @@ -127,8 +127,10 @@ static void wait_for_reply(client_t* recipient, uint64_t modify_id) */ void multicast_message(multicast_t* multicast) { + int consumed = 0; uint64_t modify_id = 0; size_t n = strlen("Modify ID: "); + if (startswith_n(multicast->message, "Modify ID: ", multicast->message_length, n)) { char* value = multicast->message + n; @@ -180,9 +182,10 @@ void multicast_message(multicast_t* multicast) if (strequals(mod->headers[i], "Modify: yes")) { modifying = 1; + consumed = mod->payload_size == 0; break; } - if (modifying) + if (modifying && !consumed) { n = mod->payload_size; old_buf = multicast->message; @@ -200,6 +203,9 @@ void multicast_message(multicast_t* multicast) /* Reset how much of the message has been sent before we continue with next recipient. */ multicast->message_ptr = 0; + + if (consumed) + break; } } |