From 249858b4af8e5cf8e03ca1e4d061a6097aba8318 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Sun, 8 Jun 2014 12:00:14 +0200 Subject: mds-echo: include message id + do not require respawn status MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- src/mds-echo.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'src/mds-echo.c') diff --git a/src/mds-echo.c b/src/mds-echo.c index 592b5b3..8d1fae0 100644 --- a/src/mds-echo.c +++ b/src/mds-echo.c @@ -22,7 +22,7 @@ #include #include -#include +#include #include #include #include @@ -44,7 +44,7 @@ server_characteristics_t server_characteristics = { .require_privileges = 0, .require_display = 1, - .require_respawn_info = 1, + .require_respawn_info = 0, .sanity_check_argc = 1 }; @@ -287,7 +287,8 @@ int echo_message(void) return 0; } - n = 1 + strlen("To: \nIn response to: \n\n") + strlen(recv_client_id) + strlen(recv_message_id); + n = 1 + strlen("To: \nIn response to: \nMessage ID: \n\n"); + n += strlen(recv_client_id) + strlen(recv_message_id) + 10; if (recv_length) n += strlen(recv_length) + 1; @@ -301,11 +302,15 @@ int echo_message(void) } } - sprintf(echo_buffer, "To: %s\nIn response to:%s\n%s%s\n", - recv_client_id, recv_message_id, + sprintf(echo_buffer, "To: %s\nIn response to:%s\nMessage ID: " PRIi32 "\n%s%s\n", + recv_client_id, recv_message_id, message_id, recv_length == NULL ? "" : recv_length, recv_length == NULL ? "" : "\n"); + message_id += 1; + if (message_id < 0) + message_id = 0; + if (full_send(echo_buffer, n - 1)) return 1; return full_send(received.payload, received.payload_size); -- cgit v1.2.3-70-g09d2