Changeset 1c6061c in code for dns.c


Ignore:
Timestamp:
Oct 28, 2014, 1:48:30 AM (11 years ago)
Author:
Mike Belopuhov <mike@…>
Branches:
master
Children:
8f5ba64
Parents:
96a2e31
Message:

Don't waste time with DNS response if the session is going away.
Downgrade DNS failures to LOG_DEBUG while here.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • dns.c

    r96a2e31 r1c6061c  
    4646        int found = 0;
    4747
     48        if (ISSETF(is->flags, ICB_SF_PENDINGDROP)) {
     49                if (ar->ar_addrinfo)
     50                        freeaddrinfo(ar->ar_addrinfo);
     51                free(is);
     52                return;
     53        }
     54
    4855        if (ar->ar_gai_errno == 0) {
    4956                if (strncmp(is->hostname, "localhost",
     
    6673                }
    6774        } else
    68                 icbd_log(is, LOG_WARNING, "dns resolution failed: %s",
     75                icbd_log(is, LOG_DEBUG, "dns resolution failed: %s",
    6976                    gai_strerror(ar->ar_gai_errno));
    7077
    7178        if (ar->ar_addrinfo)
    7279                freeaddrinfo(ar->ar_addrinfo);
    73 
    74         if (ISSETF(is->flags, ICB_SF_PENDINGDROP)) {
    75                 free(is);
    76                 return;
    77         }
    7880
    7981        CLRF(is->flags, ICB_SF_DNSINPROGRESS);
     
    101103                event_asr_run(as, dns_done_host, is);
    102104        } else {
    103                 icbd_log(is, LOG_WARNING, "reverse dns resolution failed: %s",
     105                icbd_log(is, LOG_DEBUG, "reverse dns resolution failed: %s",
    104106                    gai_strerror(ar->ar_gai_errno));
    105107                CLRF(is->flags, ICB_SF_DNSINPROGRESS);
     
    123125
    124126        return -1;
    125        
    126127}
    127128
Note: See TracChangeset for help on using the changeset viewer.