lcore.org gitweb
/
lcore.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
do SO_REUSEADDR also when listening in windows. wine needs it and it does not hurt...
[lcore.git]
/
dnsasync.pas
diff --git
a/dnsasync.pas
b/dnsasync.pas
index fab858d5033ac969c72580652e85f97b0908c036..b6e89417b3f94eff982ab846ac6f09a060e78d4c 100644
(file)
--- a/
dnsasync.pas
+++ b/
dnsasync.pas
@@
-60,18
+60,18
@@
type
//for this dnsasync object. This is not a reccomended mode of operation
\r
//because it limits the app to one dns server but is kept for compatibility
\r
//and special uses.
\r
//for this dnsasync object. This is not a reccomended mode of operation
\r
//because it limits the app to one dns server but is kept for compatibility
\r
//and special uses.
\r
- addr,port:string;
\r
+ addr,port:
ansi
string;
\r
\r
overrideaf : integer;
\r
\r
procedure cancel;//cancel an outstanding dns request
\r
\r
overrideaf : integer;
\r
\r
procedure cancel;//cancel an outstanding dns request
\r
- function dnsresult:string; //get result of dnslookup as a string
\r
+ function dnsresult:
ansi
string; //get result of dnslookup as a string
\r
procedure dnsresultbin(var binip:tbinip); //get result of dnslookup as a tbinip
\r
property dnsresultlist : tbiniplist read fresultlist;
\r
procedure dnsresultbin(var binip:tbinip); //get result of dnslookup as a tbinip
\r
property dnsresultlist : tbiniplist read fresultlist;
\r
- procedure forwardlookup(const name:string); //start forward lookup,
\r
+ procedure forwardlookup(const name:
ansi
string); //start forward lookup,
\r
//preffering ipv4
\r
procedure reverselookup(const binip:tbinip); //start reverse lookup
\r
//preffering ipv4
\r
procedure reverselookup(const binip:tbinip); //start reverse lookup
\r
- procedure customlookup(const name:string;querytype:integer); //start custom type lookup
\r
+ procedure customlookup(const name:
ansi
string;querytype:integer); //start custom type lookup
\r
\r
constructor create(aowner:tcomponent); override;
\r
destructor destroy; override;
\r
\r
constructor create(aowner:tcomponent); override;
\r
destructor destroy; override;
\r
@@
-118,7
+118,7
@@
var
Src : TInetSockAddrV;
\r
SrcLen : Integer;
\r
fromip:tbinip;
\r
Src : TInetSockAddrV;
\r
SrcLen : Integer;
\r
fromip:tbinip;
\r
- fromport:string;
\r
+ fromport:
ansi
string;
\r
begin
\r
socketno := tlsocket(sender).tag;
\r
//writeln('got a reply on socket number ',socketno);
\r
begin
\r
socketno := tlsocket(sender).tag;
\r
//writeln('got a reply on socket number ',socketno);
\r
@@
-153,7
+153,7
@@
end;
\r
function tdnsasync.sendquery(socketno:integer;const packet:tdnspacket;len:integer):boolean;
\r
var
\r
\r
function tdnsasync.sendquery(socketno:integer;const packet:tdnspacket;len:integer):boolean;
\r
var
\r
- destination :
string
;
\r
+ destination :
tbinip
;
\r
inaddr : tinetsockaddrv;
\r
trytolisten:integer;
\r
begin
\r
inaddr : tinetsockaddrv;
\r
trytolisten:integer;
\r
begin
\r
@@
-185,11
+185,11
@@
begin
end;
\r
if addr <> '' then begin
\r
dnsserverids[socketno] := -1;
\r
end;
\r
if addr <> '' then begin
\r
dnsserverids[socketno] := -1;
\r
- destination :=
addr
\r
+ destination :=
ipstrtobinf(addr);
\r
end else begin
\r
end else begin
\r
- destination := getcurrentsystemnameserver(dnsserverids[socketno]);
\r
+ destination := getcurrentsystemnameserver
bin
(dnsserverids[socketno]);
\r
end;
\r
end;
\r
- destinations[socketno] :=
ipstrtobinf(destination)
;
\r
+ destinations[socketno] :=
destination
;
\r
\r
{$ifdef ipv6}{$ifdef win32}
\r
if destinations[socketno].family = AF_INET6 then if (requestaf = useaf_default) then requestaf := useaf_preferv6;
\r
\r
{$ifdef ipv6}{$ifdef win32}
\r
if destinations[socketno].family = AF_INET6 then if (requestaf = useaf_default) then requestaf := useaf_preferv6;
\r
@@
-255,8
+255,6
@@
begin
exit;
\r
end;
\r
\r
exit;
\r
end;
\r
\r
- if (overridednsserver <> '') and (addr = '') then addr := overridednsserver;
\r
-
\r
if overrideaf = useaf_default then begin
\r
{$ifdef ipv6}
\r
{$ifdef win32}if not (usewindns and (addr = '')) then{$endif}
\r
if overrideaf = useaf_default then begin
\r
{$ifdef ipv6}
\r
{$ifdef win32}if not (usewindns and (addr = '')) then{$endif}
\r
@@
-291,15
+289,14
@@
begin
inc(numsockused);
\r
end;
\r
{$endif}
\r
inc(numsockused);
\r
end;
\r
{$endif}
\r
+
\r
for i := 0 to numsockused-1 do begin
\r
asyncprocess(i);
\r
end;
\r
for i := 0 to numsockused-1 do begin
\r
asyncprocess(i);
\r
end;
\r
-
\r
end;
\r
\r
procedure tdnsasync.reverselookup;
\r
begin
\r
end;
\r
\r
procedure tdnsasync.reverselookup;
\r
begin
\r
- if (overridednsserver <> '') and (addr = '') then addr := overridednsserver;
\r
{$ifdef win32}
\r
if usewindns and (addr = '') then begin
\r
dwas := tdnswinasync.create;
\r
{$ifdef win32}
\r
if usewindns and (addr = '') then begin
\r
dwas := tdnswinasync.create;
\r
@@
-316,7
+313,6
@@
end;
\r
procedure tdnsasync.customlookup;
\r
begin
\r
\r
procedure tdnsasync.customlookup;
\r
begin
\r
- if (overridednsserver <> '') and (addr = '') then addr := overridednsserver;
\r
setstate_custom(name,querytype,states[0]);
\r
numsockused := 1;
\r
asyncprocess(0);
\r
setstate_custom(name,querytype,states[0]);
\r
numsockused := 1;
\r
asyncprocess(0);
\r