Show
Ignore:
Timestamp:
03/25/06 18:54:12 (4 years ago)
Author:
ahu
Message:

no longer pass around IPv4 addresses as.. strings (sorry about that)

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/pdns/pdns/lwres.cc

    r598 r619  
    5858//! returns -1 for permanent error, 0 for timeout, 1 for success 
    5959/** Never throws! */ 
    60 int LWRes::asyncresolve(const string &ip, const char *domain, int type, bool doTCP, struct timeval* now) 
     60int LWRes::asyncresolve(uint32_t ip, const char *domain, int type, bool doTCP, struct timeval* now) 
    6161{ 
    6262  vector<uint8_t> vpacket; 
     
    7171 
    7272  struct sockaddr_in toaddr; 
    73   struct in_addr inp; 
    7473  Utility::socklen_t addrlen=sizeof(toaddr); 
    75   Utility::inet_aton(ip.c_str(),&inp); 
    76   toaddr.sin_addr.s_addr=inp.s_addr; 
     74  toaddr.sin_addr.s_addr=htonl(ip); 
    7775 
    7876  toaddr.sin_port=htons(53); 
     
    9593  else { 
    9694    Socket s(InterNetwork, Stream); 
    97     IPEndpoint ie(ip, 53); 
     95    IPEndpoint ie(U32ToIP(ip), 53); 
    9896    s.setNonBlocking(); 
    9997    s.connect(ie);