svn commit: r1928197 - spamassassin/trunk/lib/Mail/SpamAssassin

[email protected]
Newsgroups gmane.mail.spam.spamassassin.cvs
Message-ID <[email protected]>
Author: gbechis
Date: Wed Sep  3 08:16:10 2025
New Revision: 1928197

Log:
improve CNAME caching

Modified:
   spamassassin/trunk/lib/Mail/SpamAssassin/PerMsgStatus.pm

Modified: spamassassin/trunk/lib/Mail/SpamAssassin/PerMsgStatus.pm
==============================================================================
--- spamassassin/trunk/lib/Mail/SpamAssassin/PerMsgStatus.pm	Wed Sep  3 06:45:01 2025	(r1928196)
+++ spamassassin/trunk/lib/Mail/SpamAssassin/PerMsgStatus.pm	Wed Sep  3 08:16:10 2025	(r1928197)
@@ -2918,10 +2918,14 @@ sub add_uri_detail_list {
       my $pkt;
       eval {
         return if not defined $host;
+        return if exists $self->{dns_cname_cache}{$host};
         my $handle = $orig_resolver->bgsend($host, 'CNAME');
         $pkt = $orig_resolver->bgread($handle);
         return if !$pkt; # aborted / timed out
         my @answ = $pkt->answer;
+        # Set an invalid value in the cache, it will be overwritten later
+        # if a CNAME is present
+        $self->{dns_cname_cache}{$host} = 'invalid';
         foreach my $ans ( @answ ) {
           return if not defined $ans->cname;
           if(not exists $self->{dns_cname_cache}{$host}) {
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.