don't treat 0.0.0.0 as ip, take the nodename for the lookup instead.
authorWilfried Goesgens <dothebart@citadel.org>
Thu, 19 Jan 2012 08:36:51 +0000 (09:36 +0100)
committerWilfried Goesgens <dothebart@citadel.org>
Thu, 19 Jan 2012 08:36:51 +0000 (09:36 +0100)
citadel/modules/network/serv_networkclient.c

index 3a2a76cbdc1f656c3edbfae082b947e538ab2076..5843ae62db8fede71d2a7ad57d9d6e6d0aafa9c1 100644 (file)
@@ -888,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);