From: Giovanni Giacobbi Date: Thu, 28 Mar 2002 09:23:43 +0000 (+0000) Subject: give a better looking to silc_server_connect_to_route() X-Git-Tag: 1.2.beta1~1488 X-Git-Url: http://git.silcnet.org/gitweb/?a=commitdiff_plain;h=9c843c199d26787323601bb4cc68f2f04458a58b;p=runtime.git give a better looking to silc_server_connect_to_route() --- diff --git a/apps/silcd/server.c b/apps/silcd/server.c index d7f55286..92704074 100644 --- a/apps/silcd/server.c +++ b/apps/silcd/server.c @@ -732,9 +732,16 @@ SILC_TASK_CALLBACK(silc_server_connect_to_router) SILC_LOG_DEBUG(("We are backup router/normal server")); } + if (!server->config->routers) { + /* There wasn't a configured router, we will continue but we don't + have a connection to outside world. We will be standalone server. */ + SILC_LOG_DEBUG(("No router(s), server will be standalone")); + server->standalone = TRUE; + return; + } + /* Create the connections to all our routes */ - ptr = server->config->routers; - while (ptr) { + for (ptr = server->config->routers; ptr; ptr = ptr->next) { SILC_LOG_DEBUG(("%s connection [%s] %s:%d", ptr->backup_router ? "Backup router" : "Router", @@ -761,18 +768,7 @@ SILC_TASK_CALLBACK(silc_server_connect_to_router) (void *)sconn, 0, 1, SILC_TASK_TIMEOUT, SILC_TASK_PRI_NORMAL); } - - if (!ptr->next) - return; - - ptr = ptr->next; } - - SILC_LOG_DEBUG(("No router(s), server will be standalone")); - - /* There wasn't a configured router, we will continue but we don't - have a connection to outside world. We will be standalone server. */ - server->standalone = TRUE; } /* Second part of connecting to router(s). Key exchange protocol has been