]> 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 63c6e65412e2165b29eb2852dd1f8ace014eb7de..5843ae62db8fede71d2a7ad57d9d6e6d0aafa9c1 100644 (file)
@@ -135,8 +135,6 @@ void DeleteNetworker(void *vptr)
        FreeStrBuf(&NW->port);
        FreeStrBuf(&NW->secret);
        FreeStrBuf(&NW->Url);
-       ((struct CitContext*)NW->IO.CitContext)->state = CON_IDLE;
-       ((struct CitContext*)NW->IO.CitContext)->kill_me = 1;
        FreeAsyncIOContents(&NW->IO);
        free(NW);
 }
@@ -623,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, 
@@ -892,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);