Skip to content
Snippets Groups Projects
Commit 064fb683 authored by Rob Swindell's avatar Rob Swindell :speech_balloon:
Browse files

Twitlist optimization (don't re-read over and over)

Also added debug-level log messages for message loop rejection
reasons, for John Dovey (GATOFUEG).
parent 55091537
No related branches found
No related tags found
1 merge request!463MRC mods by Codefenix (2024-10-20)
Pipeline #2306 passed
...@@ -338,8 +338,13 @@ var exported=0; ...@@ -338,8 +338,13 @@ var exported=0;
var imported=0; var imported=0;
var subimported=0; var subimported=0;
var subpending=0; var subpending=0;
var twitlist_fname = system.ctrl_dir + "twitlist.cfg"; var twitlist = [];
var use_twitlist = file_exists(twitlist_fname);
var f = new File(system.ctrl_dir + "twitlist.cfg");
if(f.open("r")) {
twitlist = f.readAll();
f.close();
}
function article_listed(list, article) function article_listed(list, article)
{ {
...@@ -894,11 +899,13 @@ for(sub in area) { ...@@ -894,11 +899,13 @@ for(sub in area) {
// Duplicate/looped message detection here // Duplicate/looped message detection here
if(hdr.id.indexOf('@' + system.inetaddr)!=-1) { if(hdr.id.indexOf('@' + system.inetaddr)!=-1) {
log(LOG_DEBUG, "Duplicate/looped message-ID: " + hdr.id);
subpending--; subpending--;
continue; continue;
} }
if(hdr.path if(hdr.path
&& hdr.path.indexOf(system.inetaddr)!=-1) { && hdr.path.indexOf(system.inetaddr)!=-1) {
log(LOG_DEBUG, "Duplicate/looped message path: " + hdr.path);
subpending--; subpending--;
continue; continue;
} }
...@@ -907,6 +914,7 @@ for(sub in area) { ...@@ -907,6 +914,7 @@ for(sub in area) {
if(hdr.gateway if(hdr.gateway
&& hdr.gateway.indexOf(system.inetaddr)!=-1) { && hdr.gateway.indexOf(system.inetaddr)!=-1) {
log(LOG_DEBUG, "Duplicate/looped message gateway: " + hdr.gateway);
subpending--; subpending--;
continue; continue;
} }
...@@ -918,10 +926,11 @@ for(sub in area) { ...@@ -918,10 +926,11 @@ for(sub in area) {
subpending--; subpending--;
continue; continue;
} }
if(use_twitlist if(twitlist.length
&& (system.findstr(twitlist_fname,hdr.from) && (system.findstr(twitlist,hdr.from)
|| system.findstr(twitlist_fname,hdr.to))) { || system.findstr(twitlist,hdr.from_net_addr)
printf("Filtering message from %s to %s\r\n", hdr.from, hdr.to); || system.findstr(twitlist,hdr.to))) {
printf("Filtering message from %s (%s) to %s\r\n", hdr.from, hdr.from_net_addr, hdr.to);
subpending--; subpending--;
continue; continue;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment