X-Git-Url: http://www.lcore.org/git/lcore.git/blobdiff_plain/d53fe26eaac895d1e7a0ba2b2b8965cf77932de8..f04a1a66b7abbe12528bd0ced49ec44932343f41:/dnswin.pas diff --git a/dnswin.pas b/dnswin.pas index 73f97ad..e9c2a16 100755 --- a/dnswin.pas +++ b/dnswin.pas @@ -20,7 +20,6 @@ type //release should only be called from the main thread tdnswinasync=class(tthread) private - ipv6preffered : boolean; freverse : boolean; error : integer; freewhendone : boolean; @@ -32,7 +31,7 @@ type name : string; iplist : tbiniplist; - procedure forwardlookup(name:string;ipv6preffered:boolean); + procedure forwardlookup(name:string); procedure reverselookup(ip:tbinip); destructor destroy; override; procedure release; @@ -234,17 +233,7 @@ var getnameinforesult : integer; begin - if ip.family = AF_INET then begin - sa.InAddr.family := AF_INET; - sa.InAddr.port := 1; - sa.InAddr.addr := ip.ip; - end else {$ifdef ipv6}if ip.family = AF_INET6 then begin - sa.InAddr6.sin6_family := AF_INET6; - sa.InAddr6.sin6_port := 1; - sa.InAddr6.sin6_addr := ip.ip6; - end else{$endif} begin - raise exception.create('unrecognised address family'); - end; + makeinaddrv(ip,'1',sa); populateprocvars; setlength(result,1025); getnameinforesult := getnameinfo(@sa,sizeof(tinetsockaddrv),pchar(result),length(result),nil,0,0); @@ -281,10 +270,9 @@ begin end; end; -procedure tdnswinasync.forwardlookup(name:string;ipv6preffered:boolean); +procedure tdnswinasync.forwardlookup(name:string); begin self.name := name; - self.ipv6preffered := ipv6preffered; freverse := false; resume; end;