From f43a29c842c4c1c09eeffa5256caf09fd67442ed Mon Sep 17 00:00:00 2001 From: Pekka Riikonen Date: Fri, 3 Jan 2003 21:02:35 +0000 Subject: [PATCH] More log prints --- apps/silcd/server.c | 4 +++- apps/silcd/server_backup.c | 14 +++++++++++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/apps/silcd/server.c b/apps/silcd/server.c index 539b9d30..c3359196 100644 --- a/apps/silcd/server.c +++ b/apps/silcd/server.c @@ -3161,6 +3161,7 @@ void silc_server_free_sock_user_data(SilcServer server, server->id_entry->router = NULL; server->router = NULL; server->standalone = TRUE; + server->backup_primary = FALSE; backup_router = NULL; } else { if (server->id_entry != backup_router) { @@ -5061,7 +5062,8 @@ SILC_TASK_CALLBACK_GLOBAL(silc_server_rekey_final) if (protocol->state == SILC_PROTOCOL_STATE_ERROR || protocol->state == SILC_PROTOCOL_STATE_FAILURE) { /* Error occured during protocol */ - SILC_LOG_ERROR(("Error occurred during rekey protocol")); + SILC_LOG_ERROR(("Error occurred during rekey protocol with + %s (%s)", sock->hostname, sock->ip)); silc_protocol_cancel(protocol, server->schedule); silc_protocol_free(protocol); sock->protocol = NULL; diff --git a/apps/silcd/server_backup.c b/apps/silcd/server_backup.c index 548875f0..78634fe2 100644 --- a/apps/silcd/server_backup.c +++ b/apps/silcd/server_backup.c @@ -712,6 +712,8 @@ static void silc_server_backup_connect_primary(SilcServer server, idata = (SilcIDListData)server_entry; SILC_LOG_DEBUG(("Sending CONNECTED packet (session %d)", ctx->session)); + SILC_LOG_INFO(("Sending CONNECTED (session %d) to backup router", + ctx->session)); /* Send the CONNECTED packet back to the backup router. */ buffer = silc_buffer_alloc(2); @@ -914,7 +916,14 @@ SILC_TASK_CALLBACK_GLOBAL(silc_server_protocol_backup) to be back online. We send the CONNECTED packet after we've established the connection to the primary router. */ primary = silc_server_config_get_primary_router(server); - if (primary && server->backup_primary) { + if (primary && server->backup_primary && + !silc_server_num_sockets_by_remote(server, + silc_net_is_ip(primary->host) ? + primary->host : NULL, + silc_net_is_ip(primary->host) ? + NULL : primary->host, + primary->port, + SILC_SOCKET_TYPE_ROUTER)) { SILC_LOG_DEBUG(("Received START (session %d), reconnect to router", ctx->session)); silc_server_backup_reconnect(server, @@ -925,6 +934,8 @@ SILC_TASK_CALLBACK_GLOBAL(silc_server_protocol_backup) /* Nowhere to connect just return the CONNECTED packet */ SILC_LOG_DEBUG(("Received START (session %d), send CONNECTED back", ctx->session)); + SILC_LOG_INFO(("Sending CONNECTED (session %d) to backup router", + ctx->session)); /* Send the CONNECTED packet back to the backup router. */ packet = silc_buffer_alloc(2); @@ -1149,6 +1160,7 @@ SILC_TASK_CALLBACK_GLOBAL(silc_server_protocol_backup) SILC_LOG_INFO(("Resuming the use of primary router %s", router->server_name)); } + server->backup_primary = FALSE; /* Update the client entries of the backup router to the new router */ -- 2.43.0