Show
Ignore:
Timestamp:
01/21/03 11:42:34 (10 years ago)
Author:
ahu
Message:

juh

Files:
1 modified

Legend:

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

    r116 r138  
    154154  makeUDPSocket(); 
    155155  DNSPacket p; 
     156 
    156157  p.setQuestion(Opcode::Query,domain,type); 
    157158  p.wrapup(); 
     
    163164  struct sockaddr_in toaddr; 
    164165  struct in_addr inp; 
    165   Utility::inet_aton(ip.c_str(),&inp); 
     166  ServiceTuple st; 
     167  st.port=53; 
     168  parseService(ip, st); 
     169  Utility::inet_aton(st.host.c_str(),&inp); 
    166170  toaddr.sin_addr.s_addr=inp.s_addr; 
    167171 
    168   toaddr.sin_port=htons(53); 
     172  toaddr.sin_port=htons(st.port); 
    169173  toaddr.sin_family=AF_INET; 
    170174 
    171175  if(sendto(d_sock, p.getData(), p.len, 0, (struct sockaddr*)(&toaddr), sizeof(toaddr))<0) { 
    172     throw ResolverException("Unable to ask query of "+ip+": "+stringerror()); 
     176    throw ResolverException("Unable to ask query of "+st.host+":"+itoa(st.port)+": "+stringerror()); 
    173177  } 
    174178