Edit

kc3-lang/libevent/evdns-internal.h

Branch :

  • Show log

    Commit

  • Author : CXD
    Date : 2024-11-03 01:26:59
    Hash : d6dbd7f8
    Message : Windows platform supports reading IPv6 addresses for DNS server. (#1701) When using libevent on the Windows platform in an IPv6 environment, I found that libevent could not read the DNS server address for IPv6 addresses during DNS initialization, resulting in constant DNS resolution failures. Then, on MSDN, I discovered that the GetNetworkParams interface does not support obtaining IPv6 addresses, and they provided another interface, GetAdaptersAddresses, to obtain both IPv4 and IPv6 addresses. Therefore, I replaced the GetNetworkParams interface with the GetAdaptersAddresses interface. Please review whether this modification can be merged into the master branch. Reference MSDN documentation: https://learn.microsoft.com/en-us/windows/win32/api/iphlpapi/nf-iphlpapi-getnetworkparams https://learn.microsoft.com/en-us/windows/win32/api/iphlpapi/nf-iphlpapi-getadaptersaddresses Co-authored-by: alphacheng <alphacheng@tencent.com> Co-authored-by: Azat Khuzhin <azat@libevent.org> Co-authored-by: Azat Khuzhin <a3at.mail@gmail.com>

  • evdns-internal.h
  • #ifndef EVDNS_INTERNAL_H_INCLUDED_
    #define EVDNS_INTERNAL_H_INCLUDED_
    
    #ifdef __cplusplus
    extern "C" {
    #endif
    
    #include "event2/event_struct.h"
    
    #ifdef _WIN32
    
    EVENT2_EXPORT_SYMBOL
    int load_nameservers_with_getadaptersaddresses(struct evdns_base *base);
    
    #endif
    
    #ifdef __cplusplus
    }
    #endif
    
    #endif