From: beware Date: Sat, 8 Jan 2022 22:10:07 +0000 (+0000) Subject: some small fixes and improvements to dnssync and dnsasync X-Git-Url: http://www.lcore.org/git/lcore.git/commitdiff_plain/8bc22a17b97149d69fd377f5e9f5ed617a4385db some small fixes and improvements to dnssync and dnsasync git-svn-id: file:///svnroot/lcore/trunk@166 b1de8a11-f9be-4011-bde0-cc7ace90066a --- diff --git a/dnsasync.pas b/dnsasync.pas index f9fa50e..5e72cc0 100644 --- a/dnsasync.pas +++ b/dnsasync.pas @@ -12,6 +12,8 @@ unit dnsasync; {$endif} interface +{$include lcoreconfig.inc} + uses {$ifdef winasyncdns} dnswin, @@ -19,8 +21,6 @@ uses lsocket,lcore, classes,binipstuff,dnscore,btime,lcorernd; -{$include lcoreconfig.inc} - const numsock=1{$ifdef ipv6}+1{$endif}; @@ -149,7 +149,7 @@ begin if states[socketno].resultaction <> action_done then begin //we ignore packets that come after we are done if dnsserverids[socketno] >= 0 then begin - reportlag(dnsserverids[socketno],trunc((unixtimefloat-startts)*1000000)); + reportlag(dnsserverids[socketno],trunc((wintimefloat-startts)*1000000)); dnsserverids[socketno] := -1; end; { writeln('received reply');} @@ -172,7 +172,7 @@ begin result := false; if len = 0 then exit; {no packet} if sockets[socketno].state <> wsconnected then begin - startts := unixtimefloat; + startts := wintimefloat; if port = '' then port := '53'; sockets[socketno].Proto := 'udp'; sockets[socketno].ondataavailable := receivehandler; @@ -267,7 +267,7 @@ begin if overrideaf = useaf_default then begin {$ifdef ipv6} - {$ifdef mswindows}if not (usewindns and (addr = '')) then{$endif} + {$ifdef winasyncdns}if not (usewindns and (addr = '') and (overridednsserver = '')) then{$endif} initpreferredmode; {$endif} requestaf := useaf; @@ -276,7 +276,7 @@ begin end; {$ifdef winasyncdns} - if usewindns and (addr = '') then begin + if usewindns and (addr = '') and (overridednsserver = '') then begin dwas := tdnswinasync.create; dwas.onrequestdone := winrequestdone; diff --git a/dnssync.pas b/dnssync.pas index 84caf9a..66d9802 100644 --- a/dnssync.pas +++ b/dnssync.pas @@ -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;