From: Wilfried Goesgens Date: Tue, 28 Oct 2014 07:29:17 +0000 (+0100) Subject: Fix locking of netcnofigs X-Git-Tag: v9.01~101 X-Git-Url: https://code.citadel.org/?p=citadel.git;a=commitdiff_plain;h=906ed8dd506c242cffd74bbbc85b5420b948cae9 Fix locking of netcnofigs --- diff --git a/citadel/modules/network/serv_netspool.c b/citadel/modules/network/serv_netspool.c index 96ac8bf6c..714bb0471 100644 --- a/citadel/modules/network/serv_netspool.c +++ b/citadel/modules/network/serv_netspool.c @@ -209,11 +209,13 @@ void InspectQueuedRoom(SpoolControl **pSC, return; } + begin_critical_section(S_NETCONFIGS); if (sc->RNCfg == NULL) sc->RNCfg = CtdlGetNetCfgForRoom(sc->room.QRnumber); if (!HaveSpoolConfig(sc->RNCfg)) { + end_critical_section(S_NETCONFIGS); free(sc); /* nothing to do for this room... */ return; @@ -231,6 +233,7 @@ void InspectQueuedRoom(SpoolControl **pSC, if (StrLength(sc->RNCfg->Sender) > 0) sc->Users[roommailalias] = NewStrBufDup(sc->RNCfg->Sender); + end_critical_section(S_NETCONFIGS); sc->next = *pSC; *pSC = sc; @@ -400,12 +403,13 @@ void network_spoolout_room(SpoolControl *sc) /* Now rewrite the config file */ if (sc->lastsent != lastsent) { + begin_critical_section(S_NETCONFIGS); sc->RNCfg = CtdlGetNetCfgForRoom(sc->room.QRnumber); sc->RNCfg->lastsent = sc->lastsent; sc->RNCfg->changed = 1; + end_critical_section(S_NETCONFIGS); } - end_critical_section(S_NETCONFIGS); } /*