Only try to adjust upstream counters if this query has been forwarded

Signed-off-by: DL6ER <dl6er@dl6er.de>
This commit is contained in:
DL6ER
2024-10-14 18:55:46 +02:00
parent 7b7f950cce
commit f64ce8fed1
+7 -4
View File
@@ -339,10 +339,13 @@ void runGC(const time_t now, time_t *lastGCrun, const bool flush)
domain->count--;
// Adjust upstream counter (no overTime information)
upstreamsData *upstream = getUpstream(query->upstreamID, true);
if(upstream != NULL)
// Adjust upstream counter
upstream->count--;
if(query->upstreamID > -1)
{
upstreamsData *upstream = getUpstream(query->upstreamID, true);
if(upstream != NULL)
// Adjust upstream counter
upstream->count--;
}
// Change other counters according to status of this query
switch(query->status)