NETCFG: first free the configs, then the infrastructure needed to free them.
[citadel.git] / citadel / netconfig.c
index a086fea44a92da0cd401b1f9b15a7f97c571223a..f09c852fd32a3786ac5cc1f15c35c4e6fcbde087 100644 (file)
@@ -29,7 +29,7 @@
 #include <libcitadel.h>
 
 #include "include/ctdl_module.h"
-
+#include "serv_extensions.h"
 
 void vFreeRoomNetworkStruct(void *vOneRoomNetCfg);
 void FreeRoomNetworkStructContent(OneRoomNetCfg *OneRNCfg);
@@ -576,7 +576,6 @@ const ConstStr ForceAliases[nForceAliases] = {
        {HKEY("postmaster,")},
        {HKEY("abuse,")}
 };
-
 void cmd_snet(char *argbuf)
 {
        struct CitContext *CCC = CC;
@@ -726,6 +725,8 @@ void cmd_snet(char *argbuf)
                        ReadRoomNetConfigFile(&RNCfg, filename);
                        Put(RoomConfigs, LKEY(CCC->room.QRnumber), RNCfg, vFreeRoomNetworkStruct);
                }
+
+               PerformRoomHooks(&CCC->room);
        }
        end_critical_section(S_NETCONFIGS);
 }
@@ -838,6 +839,7 @@ int is_recipient(OneRoomNetCfg *RNCfg, const char *Name)
                        }
                        nptr = nptr->next;
                }
+               i++;
        }
        return 0;
 }
@@ -925,7 +927,9 @@ void cmd_netp(char *cmdbuf)
                CtdlAideFPMessage(
                        err_buf,
                        "IGNet Networking.",
-                       2, strs, (long*) &lens);
+                       2, strs, (long*) &lens,
+                       CCC->cs_pid, 0,
+                       time(NULL));
 
                DeleteHash(&working_ignetcfg);
                FreeStrBuf(&NodeStr);
@@ -950,7 +954,10 @@ void cmd_netp(char *cmdbuf)
                CtdlAideFPMessage(
                        err_buf,
                        "IGNet Networking.",
-                       2, strs, (long*) &lens);
+                       2, strs,
+                       (long*) &lens,
+                       CCC->cs_pid, 0,
+                       time(NULL));
 
                DeleteHash(&working_ignetcfg);
                FreeStrBuf(&NodeStr);
@@ -1167,11 +1174,11 @@ void destroy_network_cfgs(void)
        HashList *pCfgTypeHash = CfgTypeHash;
        HashList *pRoomConfigs = RoomConfigs;
 
-       CfgTypeHash = NULL;
        RoomConfigs = NULL;
-       
-       DeleteHash(&pCfgTypeHash);
        DeleteHash(&pRoomConfigs);
+
+       CfgTypeHash = NULL;
+       DeleteHash(&pCfgTypeHash);
 }
 
 /*