//not seem to have any form of retry code.\r
\r
unit dnsasync;\r
-\r
+{$ifdef fpc}\r
+ {$mode delphi}\r
+{$endif}\r
interface\r
\r
+{$include lcoreconfig.inc}\r
+\r
uses\r
{$ifdef winasyncdns}\r
dnswin,\r
lsocket,lcore,\r
classes,binipstuff,dnscore,btime,lcorernd;\r
\r
-{$include lcoreconfig.inc}\r
-\r
const\r
numsock=1{$ifdef ipv6}+1{$endif};\r
\r
if states[socketno].resultaction <> action_done then begin\r
//we ignore packets that come after we are done\r
if dnsserverids[socketno] >= 0 then begin\r
- reportlag(dnsserverids[socketno],trunc((unixtimefloat-startts)*1000000));\r
+ reportlag(dnsserverids[socketno],trunc((wintimefloat-startts)*1000000));\r
dnsserverids[socketno] := -1;\r
end;\r
{ writeln('received reply');}\r
result := false;\r
if len = 0 then exit; {no packet}\r
if sockets[socketno].state <> wsconnected then begin\r
- startts := unixtimefloat;\r
+ startts := wintimefloat;\r
if port = '' then port := '53';\r
sockets[socketno].Proto := 'udp';\r
sockets[socketno].ondataavailable := receivehandler;\r
\r
if overrideaf = useaf_default then begin\r
{$ifdef ipv6}\r
- {$ifdef mswindows}if not (usewindns and (addr = '')) then{$endif}\r
+ {$ifdef winasyncdns}if not (usewindns and (addr = '') and (overridednsserver = '')) then{$endif}\r
initpreferredmode;\r
{$endif}\r
requestaf := useaf;\r
end;\r
\r
{$ifdef winasyncdns}\r
- if usewindns and (addr = '') then begin\r
+ if usewindns and (addr = '') and (overridednsserver = '') then begin\r
dwas := tdnswinasync.create;\r
dwas.onrequestdone := winrequestdone;\r
\r