Strange WinINet behavior

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



When using WinINet APIs in synchronous mode and if HttpSendRequest is called
with any additional HTTP headers, then WinINet seems to use a cached IP
address for the host name that we specified in InternetConnect even after the
DNS cache timeout (configured using the method specified by
http://support.microsoft.com/kb/263558) has expired. This problem does not
occur if we use asynchronous mode (InternetOpen with INTERNET_FLAG_ASYNC
flag) or if we don’t specify any additional HTTP headers in HttpSendRequest.

Clearing the IP DNS cache (via ipconfig /flushdns) does not seem to help,
because WinINet seem to keep its own DNS cache. The only work-around that
works for me currently is to restart the application, or change the code to
use asynchronous mode, or to not pass additional headers in HttpSendRequest.

Has anyone seen this behavior before?

Thanks.


.



Relevant Pages

  • Re: Strange WinINet behavior
    ... to turn to WinHTTP as it is more advanced, rewritten version of Wininet ... with any additional HTTP headers, then WinINet seems to use a cached IP ... flag) or if we don't specify any additional HTTP headers in ... Clearing the IP DNS cache does not seem to help, ...
    (microsoft.public.win32.programmer.networks)
  • WinInet -- Disable SSL Checks for Invalid CA?
    ... certificate authority within WinInet? ... secure site (https) and HttpSendRequest() keeps returning an INVALID_CA ...
    (microsoft.public.platformsdk.security)