From f98c848366431398b8389c9786f54f9c97e01417 Mon Sep 17 00:00:00 2001 From: Wilfried Goesgens Date: Thu, 19 Jan 2012 22:25:29 +0100 Subject: [PATCH] Networker Increase logging on startup - add a counter for networkers - log before starting the context - lock inside of the connect function. --- citadel/modules/network/serv_networkclient.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/citadel/modules/network/serv_networkclient.c b/citadel/modules/network/serv_networkclient.c index c62e3f3ca..82b3920a0 100644 --- a/citadel/modules/network/serv_networkclient.c +++ b/citadel/modules/network/serv_networkclient.c @@ -822,7 +822,6 @@ eNextState nwc_connect_ip(AsyncIO *IO) AsyncNetworker *NW = IO->Data; EVN_syslog(LOG_DEBUG, "%s\n", __FUNCTION__); - EVN_syslog(LOG_DEBUG, "network: polling <%s>\n", ChrPtr(NW->node)); EVN_syslog(LOG_NOTICE, "Connecting to <%s> at %s:%s\n", ChrPtr(NW->node), ChrPtr(NW->host), @@ -834,8 +833,14 @@ eNextState nwc_connect_ip(AsyncIO *IO) 1); } +static int NetworkerCount = 0; void RunNetworker(AsyncNetworker *NW) { + AsyncIO *IO = &NW->IO; + + NW->n = NetworkerCount++; + network_talking_to(SKEY(NW->node), NTT_ADD); + EVN_syslog(LOG_DEBUG, "network: polling <%s>\n", ChrPtr(NW->node)); ParseURL(&NW->IO.ConnectMe, NW->Url, 504); InitIOStruct(&NW->IO, @@ -938,7 +943,6 @@ void network_poll_other_citadel_nodes(int full_poll, char *working_ignetcfg) ChrPtr(NW->port)); if (!network_talking_to(SKEY(NW->node), NTT_CHECK)) { - network_talking_to(SKEY(NW->node), NTT_ADD); RunNetworker(NW); continue; } -- 2.30.2