{$endif}\r
interface\r
\r
{$endif}\r
interface\r
\r
+{$include lcoreconfig.inc}\r
+\r
uses\r
{$ifdef winasyncdns}\r
dnswin,\r
uses\r
{$ifdef winasyncdns}\r
dnswin,\r
lsocket,lcore,\r
classes,binipstuff,dnscore,btime,lcorernd;\r
\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
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
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
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
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
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
\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
initpreferredmode;\r
{$endif}\r
requestaf := useaf;\r
end;\r
\r
{$ifdef winasyncdns}\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
dwas := tdnswinasync.create;\r
dwas.onrequestdone := winrequestdone;\r
\r
end;\r
\r
{$ifdef mswindows}\r
end;\r
\r
{$ifdef mswindows}\r
- if usewindns then begin\r
+ if usewindns and (overridednsserver = '') then begin\r
if (useaf = useaf_v4) then a := af_inet else if (useaf = useaf_v6) then a := af_inet6 else a := 0;\r
result := winforwardlookuplist(name,a,dummy);\r
{$ifdef ipv6}\r
if (useaf = useaf_v4) then a := af_inet else if (useaf = useaf_v6) then a := af_inet6 else a := 0;\r
result := winforwardlookuplist(name,a,dummy);\r
{$ifdef ipv6}\r
state:tdnsstatearr;\r
begin\r
{$ifdef mswindows}\r
state:tdnsstatearr;\r
begin\r
{$ifdef mswindows}\r
- if usewindns then begin\r
+ if usewindns and (overridednsserver = '') then begin\r
result := winreverselookup(ip,dummy);\r
exit;\r
end;\r
result := winreverselookup(ip,dummy);\r
exit;\r
end;\r