From ffb12fba43635d1d31d7dd073cd4d1ea7d8f4ebd Mon Sep 17 00:00:00 2001 From: beware Date: Sun, 29 Jun 2014 15:44:40 +0000 Subject: [PATCH] make windows threaded async an option and disable it, because it causes crashes git-svn-id: file:///svnroot/lcore/trunk@138 b1de8a11-f9be-4011-bde0-cc7ace90066a --- dnsasync.pas | 16 ++++++++-------- lcoreconfig.inc | 9 +++++++-- 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/dnsasync.pas b/dnsasync.pas index 59660d7..68b5c1f 100644 --- a/dnsasync.pas +++ b/dnsasync.pas @@ -11,7 +11,7 @@ unit dnsasync; interface uses - {$ifdef mswindows} + {$ifdef winasyncdns} dnswin, {$endif} lsocket,lcore, @@ -39,7 +39,7 @@ type dnsserverids : array[0..numsock-1] of integer; startts:double; - {$ifdef mswindows} + {$ifdef winasyncdns} dwas : tdnswinasync; {$endif} @@ -49,7 +49,7 @@ type procedure asyncprocess(socketno:integer); procedure receivehandler(sender:tobject;error:word); function sendquery(socketno:integer;const packet:tdnspacket;len:integer):boolean; - {$ifdef mswindows} + {$ifdef winasyncdns} procedure winrequestdone(sender:tobject;error:word); {$endif} @@ -110,7 +110,7 @@ begin end; end; - {$ifdef mswindows} + {$ifdef winasyncdns} if assigned(dwas) then begin dwas.release; dwas := nil; @@ -273,7 +273,7 @@ begin requestaf := overrideaf; end; - {$ifdef mswindows} + {$ifdef winasyncdns} if usewindns and (addr = '') then begin dwas := tdnswinasync.create; dwas.onrequestdone := winrequestdone; @@ -305,7 +305,7 @@ end; procedure tdnsasync.reverselookup; begin - {$ifdef mswindows} + {$ifdef winasyncdns} if usewindns and (addr = '') then begin dwas := tdnswinasync.create; dwas.onrequestdone := winrequestdone; @@ -342,7 +342,7 @@ procedure tdnsasync.cancel; var socketno : integer; begin - {$ifdef mswindows} + {$ifdef winasyncdns} if assigned(dwas) then begin dwas.release; dwas := nil; @@ -365,7 +365,7 @@ begin onrequestdone(self,0); end; -{$ifdef mswindows} +{$ifdef winasyncdns} procedure tdnsasync.winrequestdone(sender:tobject;error:word); begin diff --git a/lcoreconfig.inc b/lcoreconfig.inc index cda6ec7..39d1f27 100644 --- a/lcoreconfig.inc +++ b/lcoreconfig.inc @@ -33,8 +33,13 @@ so a single listener cant get all connections for a port number, only those for also it means a portable app would gave to deal with inconsistent behavior. enable this option to simulate the behavior of listening on both v4 and v6} -{$ifdef win32}{$ifdef ipv6} +{$ifdef mswindows}{$ifdef ipv6} {$define secondlistener} {$endif}{$endif} -{-------------------------------------------------------------------------------------} \ No newline at end of file +{-------------------------------------------------------------------------------------} +{the threaded windows async dns is currently (2014-03-28) broken. it causes crashes +after running for a period of time. -anders} +{$ifdef mswindows} + {-$define winasyncdns} +{$endif} -- 2.30.2