I use
DWORD totalReq = 400;
::WinHttpSetOption(sessionHandle, WINHTTP_OPTION_MAX_CONNS_PER_SERVER, &totalReq, sizeof(totalReq));
in order to limit the total number of outstanding requests to a given server I can make at some time. What I want to accomplish is to limit the possibility of a component in my application to make too many requests (they are made to the same server) because otherwise I get into memory issues with winhttp (memory builds up in winhttp.dll)
Is there a way to accomplish this using the API ? Otherwise I will have to implement this myself. What I observed about WINHTTP_OPTION_MAX_CONNS_PER_SERVER is that is indeed making possible to make that number of concurrent requests/server but that is not preventing the client code to make the requests successfully(and build up that requests in winhttp for later sending)