From dec3606868b9f659eef33f5e84e3ba1642cd9039 Mon Sep 17 00:00:00 2001 From: Art Cancro Date: Fri, 25 Mar 2016 13:03:39 -0400 Subject: [PATCH] Removed the "filter" parameter from CtdlForEachNetCfgRoom(). In the new architecture it is superfluous, and causing problems. --- citadel/citadel.h | 2 +- citadel/include/ctdl_module.h | 2 +- citadel/modules/network/serv_network.c | 2 +- citadel/modules/pop3client/serv_pop3client.c | 2 +- citadel/modules/rssclient/serv_rssclient.c | 5 +++-- citadel/room_ops.c | 14 ++++++++------ 6 files changed, 15 insertions(+), 12 deletions(-) diff --git a/citadel/citadel.h b/citadel/citadel.h index f45b0ea77..047acb6c8 100644 --- a/citadel/citadel.h +++ b/citadel/citadel.h @@ -186,7 +186,7 @@ struct floor { /* number of items which may be handled by the CONF command */ #define NUM_CONFIGS 71 -#define TRACE syslog(LOG_DEBUG, "Checkpoint: %s, %d\n", __FILE__, __LINE__) +#define TRACE syslog(LOG_DEBUG, "\033[31mCheckpoint: %s : %d\033[0m", __FILE__, __LINE__) #ifndef LONG_MAX #define LONG_MAX 2147483647L diff --git a/citadel/include/ctdl_module.h b/citadel/include/ctdl_module.h index 50490ba53..ccd01c831 100644 --- a/citadel/include/ctdl_module.h +++ b/citadel/include/ctdl_module.h @@ -247,7 +247,7 @@ void CtdlPutRoomLock(struct ctdlroom *qrbuf); typedef void (*ForEachRoomCallBack)(struct ctdlroom *EachRoom, void *out_data); void CtdlForEachRoom(ForEachRoomCallBack CB, void *in_data); typedef void (*ForEachRoomNetCfgCallBack)(struct ctdlroom *EachRoom, void *out_data, OneRoomNetCfg *OneRNCFG); -void CtdlForEachNetCfgRoom(ForEachRoomNetCfgCallBack CB, void *in_data, RoomNetCfg filter); +void CtdlForEachNetCfgRoom(ForEachRoomNetCfgCallBack CB, void *in_data); void SaveChangedConfigs(void); void CtdlDeleteRoom(struct ctdlroom *qrbuf); int CtdlRenameRoom(char *old_name, char *new_name, int new_floor); diff --git a/citadel/modules/network/serv_network.c b/citadel/modules/network/serv_network.c index ab9dbd666..a974fd93b 100644 --- a/citadel/modules/network/serv_network.c +++ b/citadel/modules/network/serv_network.c @@ -346,7 +346,7 @@ void network_do_queue(void) */ if (full_processing && !server_shutting_down) { QNM_syslog(LOG_DEBUG, "network: loading outbound queue"); - CtdlForEachNetCfgRoom(network_queue_interesting_rooms, &RL, maxRoomNetCfg); + CtdlForEachNetCfgRoom(network_queue_interesting_rooms, &RL); } if ((RL.rplist != NULL) && (!server_shutting_down)) { diff --git a/citadel/modules/pop3client/serv_pop3client.c b/citadel/modules/pop3client/serv_pop3client.c index 700c57419..221d3bb56 100644 --- a/citadel/modules/pop3client/serv_pop3client.c +++ b/citadel/modules/pop3client/serv_pop3client.c @@ -1173,7 +1173,7 @@ void pop3client_scan(void) { doing_pop3client = 1; EVP3CQM_syslog(LOG_DEBUG, "pop3client started"); - CtdlForEachNetCfgRoom(pop3client_scan_room, NULL, pop3client); + CtdlForEachNetCfgRoom(pop3client_scan_room, NULL); pthread_mutex_lock(&POP3QueueMutex); it = GetNewHashPos(POP3FetchUrls, 0); diff --git a/citadel/modules/rssclient/serv_rssclient.c b/citadel/modules/rssclient/serv_rssclient.c index 7e5d03c40..4daba9bdd 100644 --- a/citadel/modules/rssclient/serv_rssclient.c +++ b/citadel/modules/rssclient/serv_rssclient.c @@ -893,12 +893,13 @@ void rssclient_scan(void) { "rssclient: concurrency check failed; %d rooms and %d url's are queued", RSSRoomCount, RSSCount ); + abort(); return; } become_session(&rss_CC); EVRSSQM_syslog(LOG_DEBUG, "rssclient started"); - CtdlForEachNetCfgRoom(rssclient_scan_room, NULL, rssclient); + CtdlForEachNetCfgRoom(rssclient_scan_room, NULL); if (GetCount(RSSFetchUrls) > 0) { @@ -973,7 +974,7 @@ int RSSCheckUsetableVeto(StrBuf *ErrMsg) Info.Now = time (NULL); Info.Veto = 0; - CtdlForEachNetCfgRoom(rssclient_veto_scan_room, &Info, rssclient); + CtdlForEachNetCfgRoom(rssclient_veto_scan_room, &Info); return Info.Veto;; } diff --git a/citadel/room_ops.c b/citadel/room_ops.c index a018662d9..6a5749376 100644 --- a/citadel/room_ops.c +++ b/citadel/room_ops.c @@ -659,7 +659,7 @@ void CtdlForEachRoom(ForEachRoomCallBack CB, void *in_data) /* * Iterate through the room table, performing a callback for each room that has a netconfig entry. */ -void CtdlForEachNetCfgRoom(ForEachRoomNetCfgCallBack CB, void *in_data, RoomNetCfg filter) +void CtdlForEachNetCfgRoom(ForEachRoomNetCfgCallBack CB, void *in_data) { struct ctdlroom qrbuf; struct cdbdata *cdbqr; @@ -668,21 +668,23 @@ void CtdlForEachNetCfgRoom(ForEachRoomNetCfgCallBack CB, void *in_data, RoomNetC while (cdbqr = cdb_next_item(CDB_ROOMS), cdbqr != NULL) { memset(&qrbuf, 0, sizeof(struct ctdlroom)); - memcpy(&qrbuf, cdbqr->ptr, - ((cdbqr->len > sizeof(struct ctdlroom)) ? - sizeof(struct ctdlroom) : cdbqr->len) - ); + memcpy(&qrbuf, cdbqr->ptr, ((cdbqr->len > sizeof(struct ctdlroom)) ? sizeof(struct ctdlroom) : cdbqr->len)); cdb_free(cdbqr); room_sanity_check(&qrbuf); if (qrbuf.QRflags & QR_INUSE) { OneRoomNetCfg *RNCfg; RNCfg = CtdlGetNetCfgForRoom(qrbuf.QRnumber); - if ((RNCfg != NULL) && ((filter == maxRoomNetCfg) || (RNCfg->NetConfigs[filter] != NULL))) + if (RNCfg != NULL) { + TRACE; CB(&qrbuf, in_data, RNCfg); FreeRoomNetworkStruct(&RNCfg); } + else + { + TRACE; + } } } } -- 2.30.2