X-Git-Url: https://code.citadel.org/?a=blobdiff_plain;f=citadel%2Fmodules%2Fnetwork%2Fserv_network.c;h=6c9ed94b95c7625c1656f1b8814ccb8aa02383bf;hb=ce8ccae34638f0a250526db7da80b7ce412eb3a2;hp=5dedf0c536ec52754710e18c0078b74182fd8f20;hpb=af57df943c714ba422cc5d54ff7639f6078b3c0c;p=citadel.git diff --git a/citadel/modules/network/serv_network.c b/citadel/modules/network/serv_network.c index 5dedf0c53..6c9ed94b9 100644 --- a/citadel/modules/network/serv_network.c +++ b/citadel/modules/network/serv_network.c @@ -176,7 +176,7 @@ int network_sync_to(char *target_node, long len) pCfgLine = pRNCFG->NetConfigs[ignet_push_share]; while (pCfgLine != NULL) { - if (strcmp(ChrPtr(pCfgLine->Value[0]), target_node)) + if (!strcmp(ChrPtr(pCfgLine->Value[0]), target_node)) break; pCfgLine = pCfgLine->next; } @@ -184,10 +184,25 @@ int network_sync_to(char *target_node, long len) { return -1; } + memset(&sc, 0, sizeof(SpoolControl)); memset(&OneRNCFG, 0, sizeof(OneRoomNetCfg)); sc.RNCfg = &OneRNCFG; sc.RNCfg->NetConfigs[ignet_push_share] = DuplicateOneGenericCfgLine(pCfgLine); + sc.Users[ignet_push_share] = NewStrBufPlain(NULL, + StrLength(pCfgLine->Value[0]) + + StrLength(pCfgLine->Value[1]) + 10); + StrBufAppendBuf(sc.Users[ignet_push_share], + pCfgLine->Value[0], + 0); + StrBufAppendBufPlain(sc.Users[ignet_push_share], + HKEY(","), + 0); + + StrBufAppendBuf(sc.Users[ignet_push_share], + pCfgLine->Value[1], + 0); + CalcListID(&sc); end_critical_section(S_NETCONFIGS); @@ -203,6 +218,7 @@ int network_sync_to(char *target_node, long len) DeleteHash(&sc.working_ignetcfg); DeleteHash(&sc.the_netmap); + free_spoolcontrol_struct_members(&sc); QN_syslog(LOG_NOTICE, "Synchronized %d messages to <%s>\n", num_spooled, target_node); @@ -439,19 +455,6 @@ void network_bounce(struct CtdlMessage *msg, char *reason) } -void free_network_spoolout_room(SpoolControl *sc) -{ - if (sc != NULL) - { - int i; - for (i = subpending; i < maxRoomNetCfg; i++) - FreeStrBuf(&sc->Users[i]); - free(sc); - } -} - - - /* * network_do_queue() @@ -551,7 +554,7 @@ void network_do_queue(void) while (pSC != NULL) { sc = pSC->next; - free_network_spoolout_room(pSC); + free_spoolcontrol_struct(&pSC); pSC = sc; } /* If there is anything in the inbound queue, process it */