X-Git-Url: http://www.lcore.org/git/lcore.git/blobdiff_plain/968c333d05db5d5ecf3599f8e304c67e64f21159..a77cd534c22418ec9a8a22ae42efef1a9500b193:/dnssync.pas diff --git a/dnssync.pas b/dnssync.pas index 7dedcca..66d9802 100644 --- a/dnssync.pas +++ b/dnssync.pas @@ -31,9 +31,9 @@ interface //convert a name to an IP //will return v4 or v6 depending on what seems favorable, or manual preference setting -//on error the binip will have a family of 0 (other fiels are also currently +//on error the binip will have a family of 0 (other fields are also currently //zeroed out but may be used for further error information in future) -//timeout is in miliseconds, it is ignored when using windows dns +//timeout is in milliseconds, it is ignored when using windows dns function forwardlookup(name:ansistring;timeout:integer):tbinip; //convert a name to a list of all IP's returned @@ -94,7 +94,7 @@ begin var temp:ttimeval; begin - gettimeofday(temp); + gettimemonotonic(temp); result := ((temp.tv_usec div 1000) + (temp.tv_sec * 1000)) and tsmask; {$endif} end; @@ -256,7 +256,7 @@ begin selecttimeout.tv_sec := 0; selecttimeout.tv_usec := retryafter; end; - //find the highest of the used fd's + //find the highest of the used fds b := 0; for socknum := numsockused-1 downto 0 do if fd[socknum] > b then b := fd[socknum]; selectresult := select(b+1,@fds,nil,nil,@selecttimeout); @@ -328,7 +328,7 @@ begin end; {$ifdef mswindows} - if usewindns then begin + if usewindns and (overridednsserver = '') then begin if (useaf = useaf_v4) then a := af_inet else if (useaf = useaf_v6) then a := af_inet6 else a := 0; result := winforwardlookuplist(name,a,dummy); {$ifdef ipv6} @@ -399,7 +399,7 @@ var state:tdnsstatearr; begin {$ifdef mswindows} - if usewindns then begin + if usewindns and (overridednsserver = '') then begin result := winreverselookup(ip,dummy); exit; end;