void vFreeRoomNetworkStruct(void *vOneRoomNetCfg);
+void FreeRoomNetworkStructContent(OneRoomNetCfg *OneRNCfg);
HashList *CfgTypeHash = NULL;
HashList *RoomConfigs = NULL;
const CfgLineType *pCfg;
StrBuf *Line;
StrBuf *InStr;
- OneRoomNetCfg *OneRNCfg;
+ OneRoomNetCfg *OneRNCfg = NULL;
fd = open(filename, O_NONBLOCK|O_RDONLY);
if (fd == -1) {
return 0;
}
if (*pOneRNCfg != NULL)
+ {
OneRNCfg = *pOneRNCfg;
+ FreeRoomNetworkStructContent (OneRNCfg);
+ }
else
OneRNCfg = malloc(sizeof(OneRoomNetCfg));
memset(OneRNCfg, 0, sizeof(OneRoomNetCfg));
const char* RemoteIdentifier)
{
OneRoomNetCfg *RNCfg;
- char filename[SIZ];
int found;
if (RemoteIdentifier == NULL)
return (ERROR + USERNAME_REQUIRED);
}
- assoc_file_name(filename, sizeof filename, &CC->room, ctdl_netcfg_dir);
begin_critical_section(S_NETCONFIGS);
- if (!ReadRoomNetConfigFile(&RNCfg, filename))
+ RNCfg = CtdlGetNetCfgForRoom (CC->room.QRnumber);
+ if (RNCfg == NULL)
{
end_critical_section(S_NETCONFIGS);
snprintf(errmsgbuf, n,
"This mailing list only accepts posts from subscribers.");
return (ERROR + NO_SUCH_USER);
}
- end_critical_section(S_NETCONFIGS);
found = is_recipient (RNCfg, RemoteIdentifier);
- vFreeRoomNetworkStruct(&RNCfg);
+ end_critical_section(S_NETCONFIGS);
+
if (found) {
return (0);
}