socket: improve gethostbyname and getaddrinfo; drop getnameinfo
- use evdns module - gethostbyname() * check if hostname has no dots; if so, call the standard gethostbyname() * same goes if hostname is not of str type - getaddrinfo(): * check if host has no dots, not a string or is an IP address; if so, call getaddrinfo() * filter out the results based on passed socktype and proto arguments * add evdns_flags keyword argument that is passed unchanged to evdns functions - getnameinfo() is gone; it did not match the original getnameinfo() API at all but was a proxy to dns_resolve_reverse(). Since the latter is now available in evdns module, this getnameinfo() is not needed - rename internal variable _ip_re to _ip4_re - remove unused variable BUFFER_SIZE
Showing
Please register or sign in to comment