From f77e58a44128d6e3434b20e6a837103e73570d37 Mon Sep 17 00:00:00 2001 From: Pekka Riikonen Date: Thu, 17 Jul 2003 17:49:22 +0000 Subject: [PATCH] Fixed same sending error as with previous error sending. --- apps/silcd/server_query.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/apps/silcd/server_query.c b/apps/silcd/server_query.c index 473a13f2..3414c650 100644 --- a/apps/silcd/server_query.c +++ b/apps/silcd/server_query.c @@ -1136,6 +1136,10 @@ void silc_server_query_send_reply(SilcServer server, bool sent_reply = FALSE; SILC_LOG_DEBUG(("Sending reply to query")); + SILC_LOG_DEBUG(("Sending %d clients", clients_count)); + SILC_LOG_DEBUG(("Sending %d servers", servers_count)); + SILC_LOG_DEBUG(("Sending %d channels", channels_count)); + SILC_LOG_DEBUG(("Sending %d errors", query->errors_count)); status = SILC_STATUS_OK; @@ -1144,8 +1148,6 @@ void silc_server_query_send_reply(SilcServer server, SilcClientEntry entry; SilcSocketConnection hsock; - SILC_LOG_DEBUG(("Sending %d clients", clients_count)); - /* Mark all invalid entries */ for (i = 0, valid_count = 0; i < clients_count; i++) { entry = clients[i]; @@ -1387,8 +1389,6 @@ void silc_server_query_send_reply(SilcServer server, if (query->querycmd == SILC_COMMAND_IDENTIFY && servers_count) { SilcServerEntry entry; - SILC_LOG_DEBUG(("Sending %d servers", servers_count)); - if (status == SILC_STATUS_OK && servers_count > 1) status = SILC_STATUS_LIST_START; @@ -1398,6 +1398,9 @@ void silc_server_query_send_reply(SilcServer server, if (k >= 1) status = SILC_STATUS_LIST_ITEM; + if (servers_count == 1 && status != SILC_STATUS_OK && !channels_count && + !query->errors_count) + status = SILC_STATUS_LIST_END; if (servers_count > 1 && k == servers_count - 1 && !channels_count && !query->errors_count) status = SILC_STATUS_LIST_END; @@ -1433,8 +1436,6 @@ void silc_server_query_send_reply(SilcServer server, if (query->querycmd == SILC_COMMAND_IDENTIFY && channels_count) { SilcChannelEntry entry; - SILC_LOG_DEBUG(("Sending %d channels", channels_count)); - if (status == SILC_STATUS_OK && channels_count > 1) status = SILC_STATUS_LIST_START; @@ -1444,6 +1445,9 @@ void silc_server_query_send_reply(SilcServer server, if (k >= 1) status = SILC_STATUS_LIST_ITEM; + if (channels_count == 1 && status != SILC_STATUS_OK && + !query->errors_count) + status = SILC_STATUS_LIST_END; if (channels_count > 1 && k == channels_count - 1 && !query->errors_count) status = SILC_STATUS_LIST_END; @@ -1479,8 +1483,6 @@ void silc_server_query_send_reply(SilcServer server, if (query->errors_count) { int type; - SILC_LOG_DEBUG(("Sending %d errors", query->errors_count)); - if (status == SILC_STATUS_OK && query->errors_count > 1) status = SILC_STATUS_LIST_START; -- 2.24.0