From 906ed8dd506c242cffd74bbbc85b5420b948cae9 Mon Sep 17 00:00:00 2001 From: Wilfried Goesgens Date: Tue, 28 Oct 2014 08:29:17 +0100 Subject: [PATCH] Fix locking of netcnofigs --- citadel/modules/network/serv_netspool.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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); } /* -- 2.30.2