Angus, thanks for testing my changes!
This patch indeed only calls DnsLookup before Connect transparently to client 
software.
I've did another patch (and another option wsoIcsDnsLookup) that allow using 
non-Winsock ICS DNS lookup though it's just not thoroughfully tested yet. In my 
primitive test case (connect to existing / not existing host) it worked nice 
but I'm not sure that I've modified all necessary places.

Here's the patch:
Source/OverbyteIcsWSocket.pas | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/Source/OverbyteIcsWSocket.pas b/Source/OverbyteIcsWSocket.pas
index ebdb0cb..630340f 100644
--- a/Source/OverbyteIcsWSocket.pas
+++ b/Source/OverbyteIcsWSocket.pas
@@ -1640,7 +1640,7 @@ type
                          wsoNoHttp10Tunnel,
                          wsoNotifyAddressListChange,
                          wsoNotifyRoutingInterfaceChange,
-                          wsoAsyncDnsLookup);
+                          wsoAsyncDnsLookup, wsoIcsDnsLookup);
  TWSocketOptions      = set of TWSocketOption;

  TTcpKeepAlive = packed record
@@ -8431,7 +8431,7 @@ begin
    ErrCode := IcsHiWord(Msg.LParam);
    if ErrCode = 0 then begin
      {$IFDEF MSWINDOWS}
-        if FSocketFamily = sfIPv4 then begin
+        if (FSocketFamily = sfIPv4) and not (wsoIcsDnsLookup in 
ComponentOptions) then begin
            Phe := PHostent(@FDnsLookupBuffer);
            if phe <> nil then begin
                GetIpList(Phe, FDnsResultList);
@@ -9117,7 +9117,7 @@ begin
        Exit;
    FInternalDnsActive := FALSE;
  {$IFDEF MSWINDOWS}
-    if FSocketFamily = sfIPv4 then
+    if (FSocketFamily = sfIPv4) and not (wsoIcsDnsLookup in ComponentOptions) 
then
        RetVal := WSocket_Synchronized_WSACancelAsyncRequest(FDnsLookupHandle)
    else
  {$ENDIF}
@@ -9170,7 +9170,7 @@ begin
    { Cancel any pending lookup }
    if FDnsLookupHandle <> 0 then begin
    {$IFDEF MSWINDOWS}
-        if FSocketFamily = sfIPv4 then
+        if (FSocketFamily = sfIPv4) and not (wsoIcsDnsLookup in 
ComponentOptions) then
            WSocket_Synchronized_WSACancelAsyncRequest(FDnsLookupHandle)
        else
    {$ENDIF}
@@ -9223,7 +9223,7 @@ begin
    { WMAsyncGetHostByName. John use a flag to check this situation.         }
    FDnsLookupCheckMsg := FALSE;
  {$IFDEF MSWINDOWS}
-    if FSocketFamily = sfIPv4 then
+    if (FSocketFamily = sfIPv4) and not (wsoIcsDnsLookup in ComponentOptions) 
then
        FDnsLookupHandle   := WSocket_Synchronized_WSAAsyncGetHostByName(
                                  FWindowHandle,
                                  FMsg_WM_ASYNCGETHOSTBYNAME,
@@ -23841,7 +23841,7 @@ begin
    LockQueue;
    try
      {$IFDEF MSWINDOWS}
-        if not IsIPv6APIAvailable then begin
+        if (ASocketFamily = sfIPv6) and not IsIPv6APIAvailable then begin
            SetLastError(WSAVERNOTSUPPORTED);
            Exit;
        end;
@@ -23927,7 +23927,7 @@ begin
    LockQueue;
    try
      {$IFDEF MSWINDOWS}
-        if not IsIPv6APIAvailable then begin
+        if (Req.FSocketFamily = sfIPv6) and not IsIPv6APIAvailable then begin
            Result := -1;
            SetLastError(WSAVERNOTSUPPORTED);
            Exit;



--
Отправлено с кофеварки
A.S.
--
To unsubscribe or change your settings for TWSocket mailing list
please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be

Reply via email to