]> code.citadel.org Git - citadel.git/blobdiff - citadel/netconfig.c
RNCFG: protect deletion of configs
[citadel.git] / citadel / netconfig.c
index 682d4e05acb301b59eb54a3293862e508743cb38..9e3fdc9cb84265f29908c3b072811c4246181d93 100644 (file)
@@ -839,6 +839,7 @@ int is_recipient(OneRoomNetCfg *RNCfg, const char *Name)
                        }
                        nptr = nptr->next;
                }
+               i++;
        }
        return 0;
 }
@@ -927,6 +928,7 @@ void cmd_netp(char *cmdbuf)
                        err_buf,
                        "IGNet Networking.",
                        2, strs, (long*) &lens,
+                       CCC->cs_pid, 0,
                        time(NULL));
 
                DeleteHash(&working_ignetcfg);
@@ -954,6 +956,7 @@ void cmd_netp(char *cmdbuf)
                        "IGNet Networking.",
                        2, strs,
                        (long*) &lens,
+                       CCC->cs_pid, 0,
                        time(NULL));
 
                DeleteHash(&working_ignetcfg);
@@ -1169,13 +1172,16 @@ int CtdlIsValidNode(const StrBuf **nexthop,
 void destroy_network_cfgs(void)
 {
        HashList *pCfgTypeHash = CfgTypeHash;
-       HashList *pRoomConfigs = RoomConfigs;
+       HashList *pRoomConfigs;
 
-       CfgTypeHash = NULL;
+       begin_critical_section(S_NETCONFIGS);
+       pRoomConfigs = RoomConfigs;
        RoomConfigs = NULL;
-       
-       DeleteHash(&pCfgTypeHash);
+       end_critical_section(S_NETCONFIGS);
        DeleteHash(&pRoomConfigs);
+
+       CfgTypeHash = NULL;
+       DeleteHash(&pCfgTypeHash);
 }
 
 /*