]> code.citadel.org Git - citadel.git/blobdiff - citadel/modules/network/serv_networkclient.c
don't treat 0.0.0.0 as ip, take the nodename for the lookup instead.
[citadel.git] / citadel / modules / network / serv_networkclient.c
index 7f4ca89d11a3f3f873d5dade7724d1157784766d..5843ae62db8fede71d2a7ad57d9d6e6d0aafa9c1 100644 (file)
@@ -621,8 +621,6 @@ eNextState nwc_get_one_host_ip(AsyncIO *IO)
         * here we start with the lookup of one host.
         */ 
 
-       InitC_ares_dns(IO);
-
        syslog(LOG_DEBUG, "NWC: %s\n", __FUNCTION__);
 
        syslog(LOG_DEBUG, 
@@ -890,10 +888,17 @@ void network_poll_other_citadel_nodes(int full_poll, char *working_ignetcfg)
                        }
                        if (poll) {
                                NW->Url = NewStrBufPlain(NULL, StrLength(Line));
-                               StrBufPrintf(NW->Url, "citadel://:%s@%s:%s", 
-                                            ChrPtr(NW->secret),
-                                            ChrPtr(NW->host),
-                                            ChrPtr(NW->port));
+                               if ((StrLength (NW->host) > NULL) && (!strcmp(NW->host, "0.0.0.0")))
+                                       StrBufPrintf(NW->Url, "citadel://:%s@%s:%s", 
+                                                    ChrPtr(NW->secret),
+                                                    ChrPtr(NW->host),
+                                                    ChrPtr(NW->port));
+                               else
+                                       StrBufPrintf(NW->Url, "citadel://:%s@%s:%s", 
+                                                    ChrPtr(NW->secret),
+                                                    ChrPtr(NW->node),
+                                                    ChrPtr(NW->port));
+
                                if (!network_talking_to(SKEY(NW->node), NTT_CHECK))
                                {
                                        network_talking_to(SKEY(NW->node), NTT_ADD);