typedef struct __roomlists {
RoomProcList *rplist;
- HashList *RoomsInterestedIn;
}roomlists;
/*
* When we do network processing, it's accomplished in two passes; one to
int network_sync_to(char *target_node, long len)
{
struct CitContext *CCC = CC;
- const OneRoomNetCfg *OneRNCFG;
+ OneRoomNetCfg OneRNCFG;
+ OneRoomNetCfg *pRNCFG;
const RoomNetCfgLine *pCfgLine;
SpoolControl sc;
int num_spooled = 0;
/* Grab the configuration line we're looking for */
begin_critical_section(S_NETCONFIGS);
- OneRNCFG = CtdlGetNetCfgForRoom(CCC->room.QRnumber);
- if ((OneRNCFG == NULL) ||
- (OneRNCFG->NetConfigs[ignet_push_share] == NULL))
+ pRNCFG = CtdlGetNetCfgForRoom(CCC->room.QRnumber);
+ if ((pRNCFG == NULL) ||
+ (pRNCFG->NetConfigs[ignet_push_share] == NULL))
{
return -1;
}
- pCfgLine = OneRNCFG->NetConfigs[ignet_push_share];
+ pCfgLine = pRNCFG->NetConfigs[ignet_push_share];
while (pCfgLine != NULL)
{
if (strcmp(ChrPtr(pCfgLine->Value[0]), target_node))
return -1;
}
memset(&sc, 0, sizeof(SpoolControl));
-
- sc.NetConfigs[ignet_push_share] = DuplicateOneGenericCfgLine(pCfgLine);
+ memset(&OneRNCFG, 0, sizeof(OneRoomNetCfg));
+ sc.RNCfg = &OneRNCFG;
+ sc.RNCfg->NetConfigs[ignet_push_share] = DuplicateOneGenericCfgLine(pCfgLine);
end_critical_section(S_NETCONFIGS);
network_spool_msg, &sc);
/* Concise cleanup because we know there's only one node in the sc */
- DeleteGenericCfgLine(NULL/*TODO*/, &sc.NetConfigs[ignet_push_share]);
+ DeleteGenericCfgLine(NULL/*TODO*/, &sc.RNCfg->NetConfigs[ignet_push_share]);
DeleteHash(&sc.working_ignetcfg);
DeleteHash(&sc.the_netmap);
ptr->lcname[ptr->namelen] = '\0';
ptr->key = hashlittle(ptr->lcname, ptr->namelen, 9872345);
- ptr->OneRNCFG = OneRNCFG;
+ ptr->OneRNCfg = OneRNCFG;
return ptr;
}
void network_do_queue(void)
{
struct CitContext *CCC = CC;
- static int doing_queue = 0;
static time_t last_run = 0L;
int full_processing = 1;
HashList *working_ignetcfg;
);
}
- /*
- * This is a simple concurrency check to make sure only one queue run
- * is done at a time. We could do this with a mutex, but since we
- * don't really require extremely fine granularity here, we'll do it
- * with a static variable instead.
- */
- if (doing_queue) {
- return;
- }
- doing_queue = 1;
-
become_session(&networker_spool_CC);
begin_critical_section(S_RPLIST);
RL.rplist = rplist;
while (ptr != NULL && !server_shutting_down) {
cmp = ptr->next;
-
+ /* filter duplicates from the list... */
while (cmp != NULL) {
if ((cmp->namelen > 0) &&
(cmp->key == ptr->key) &&
if (full_processing) {
last_run = time(NULL);
}
- DeleteHash(&RL.RoomsInterestedIn);
destroy_network_queue_room(RL.rplist);
- doing_queue = 0;
}