Negated a strcmp in netconf.c that caused the function to hang every single time...
authorArt Cancro <ajc@uncensored.citadel.org>
Wed, 7 Sep 2011 19:43:37 +0000 (15:43 -0400)
committerWilfried Goesgens <dothebart@citadel.org>
Tue, 13 Sep 2011 16:56:56 +0000 (16:56 +0000)
webcit/netconf.c
webcit/tcp_sockets.c

index 8683879..a426217 100644 (file)
@@ -88,14 +88,13 @@ HashList *load_netconf(StrBuf *Target, WCTemplputParams *TP)
                Hash = NewHash(1, NULL);
 
                Buf = NewStrBuf();
-               while ((len = StrBuf_ServGetln(Buf),
-                       (len != 3) || !strcmp(ChrPtr(Buf), "000"))) {
+               while (len = StrBuf_ServGetln(Buf), strcmp(ChrPtr(Buf), "000")) {
                        Node = NewNode(Buf);
-                       if (Node == NULL)
-                               continue;
-                       nUsed = GetCount(Hash);
-                       nUsed = snprintf(nnn, sizeof(nnn), "%d", nUsed+1);
-                       Put(Hash, nnn, nUsed, Node, DeleteNodeConf); 
+                       if (Node != NULL) {
+                               nUsed = GetCount(Hash);
+                               nUsed = snprintf(nnn, sizeof(nnn), "%d", nUsed+1);
+                               Put(Hash, nnn, nUsed, Node, DeleteNodeConf); 
+                       }
                }
                FreeStrBuf(&Buf);
                return Hash;
index da483de..bb4d601 100644 (file)
@@ -18,8 +18,8 @@
 
 /*
  * Uncomment this to log all communications with the Citadel server
-#define SERV_TRACE 1
  */
+#define SERV_TRACE 1
 
 
 #include "webcit.h"