lcore.org gitweb
/
lcore.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fix destroysourcestream always false bug
[lcore.git]
/
dnssync.pas
diff --git
a/dnssync.pas
b/dnssync.pas
index c603b9267a892b071ec96631dca3fa4e5d371539..1a506d5a93a92676ae1e39695f53554613f2c89b 100644
(file)
--- a/
dnssync.pas
+++ b/
dnssync.pas
@@
-109,7
+109,7
@@
end;
\r
function sendquery(socknum:integer;const packet:tdnspacket;len:integer):boolean;
\r
var
\r
\r
function sendquery(socknum:integer;const packet:tdnspacket;len:integer):boolean;
\r
var
\r
-
addr : ansistring
;
\r
+
ip : tbinip
;
\r
port : ansistring;
\r
inaddr : TInetSockAddrV;
\r
begin
\r
port : ansistring;
\r
inaddr : TInetSockAddrV;
\r
begin
\r
@@
-117,14
+117,14
@@
begin
result := false;
\r
if len = 0 then exit; {no packet}
\r
\r
result := false;
\r
if len = 0 then exit; {no packet}
\r
\r
- i
f overridednsserver <> '' then addr := overridednsserver else addr := getcurrentsystemnameserver
(id);
\r
+ i
p := getcurrentsystemnameserverbin
(id);
\r
\r
{$ifdef ipv6}{$ifdef win32}
\r
if toaddr[socknum].family = AF_INET6 then if (useaf = 0) then useaf := useaf_preferv6;
\r
{$endif}{$endif}
\r
\r
port := toport;
\r
\r
{$ifdef ipv6}{$ifdef win32}
\r
if toaddr[socknum].family = AF_INET6 then if (useaf = 0) then useaf := useaf_preferv6;
\r
{$endif}{$endif}
\r
\r
port := toport;
\r
- toaddr[socknum] := ip
strtobinf(addr)
;
\r
+ toaddr[socknum] := ip;
\r
makeinaddrv(toaddr[socknum],port,inaddr);
\r
\r
sendto(fd[socknum],packet,len,0,inaddr,inaddrsize(inaddr));
\r
makeinaddrv(toaddr[socknum],port,inaddr);
\r
\r
sendto(fd[socknum],packet,len,0,inaddr,inaddrsize(inaddr));
\r
@@
-137,16
+137,14
@@
var
inAddrtemp : TInetSockAddrV;
\r
a:integer;
\r
biniptemp:tbinip;
\r
inAddrtemp : TInetSockAddrV;
\r
a:integer;
\r
biniptemp:tbinip;
\r
- addr:ansistring;
\r
+
\r
begin
\r
//init both sockets smultaneously, always, so they get succesive fd's
\r
if fd[0] > 0 then exit;
\r
\r
begin
\r
//init both sockets smultaneously, always, so they get succesive fd's
\r
if fd[0] > 0 then exit;
\r
\r
-
if overridednsserver <> '' then addr := overridednsserver else addr := getcurrentsystemnameserver
(id);
\r
+
biniptemp := getcurrentsystemnameserverbin
(id);
\r
//must get the DNS server here so we know to init v4 or v6
\r
\r
//must get the DNS server here so we know to init v4 or v6
\r
\r
- ipstrtobin(addr,biniptemp);
\r
-
\r
if biniptemp.family = AF_INET6 then biniptemp := ipstrtobinf('::') else biniptemp := ipstrtobinf('0.0.0.0');
\r
\r
\r
if biniptemp.family = AF_INET6 then biniptemp := ipstrtobinf('::') else biniptemp := ipstrtobinf('0.0.0.0');
\r
\r
\r
@@
-255,7
+253,7
@@
begin
fillchar(state[socknum].recvpacket,sizeof(state[socknum].recvpacket),0);
\r
msectotimeval(lag,(currenttime-sendquerytime[socknum]) and tsmask);
\r
\r
fillchar(state[socknum].recvpacket,sizeof(state[socknum].recvpacket),0);
\r
msectotimeval(lag,(currenttime-sendquerytime[socknum]) and tsmask);
\r
\r
-
if overridednsserver = '' then
reportlag(id,(lag.tv_sec*1000000)+lag.tv_usec);
\r
+ reportlag(id,(lag.tv_sec*1000000)+lag.tv_usec);
\r
\r
SrcLen := SizeOf(Src);
\r
state[socknum].recvpacketlen := recvfrom(fd[socknum],state[socknum].recvpacket, SizeOf(state[socknum].recvpacket),0,Srcx,SrcLen);
\r
\r
SrcLen := SizeOf(Src);
\r
state[socknum].recvpacketlen := recvfrom(fd[socknum],state[socknum].recvpacket, SizeOf(state[socknum].recvpacket),0,Srcx,SrcLen);
\r
@@
-278,7
+276,7
@@
begin
\r
currenttime := getts;
\r
\r
\r
currenttime := getts;
\r
\r
-
if overridednsserver = '' then
reportlag(id,-1);
\r
+ reportlag(id,-1);
\r
if (currenttime >= endtime) and ((not wrapmode) or (currenttime < starttime)) then begin
\r
exit;
\r
end else begin
\r
if (currenttime >= endtime) and ((not wrapmode) or (currenttime < starttime)) then begin
\r
exit;
\r
end else begin
\r