Hardware and software:
ADS Graphics Master Rom Ver. 1.79 (DRAM : 64 MB, CL:3)(Build at 12:37:12 on Nov 28 2001)
Microsoft Windows CE Ver. 3.0 (build 126) ADS GMASTER Windows CE Ver.(3.33)
I'm using HttpSendRequest to POST data to some Intranet/Internet website and read the response. Everytime I call HttpSendRequest I loose about 8kb of memory. This however only occurse when I do not use a proxy server. When using a proxy server, no memory is lost.
The small test program I'm using does NOT use MFC, ATL, STL or any other library. All data is either static or on the stack, no memory is allocated on the heap.
I don't know how I can post the code of this app so that someone else might have a look at it. But I'll try to paste the most relevant parts.
// Use Proxyserver m_hHttpOpen = InternetOpen(_T("ES2X ADSHW 3.05"), INTERNET_OPEN_TYPE_PROXY, m_ProxyServer, NULL, 0);
// Don't use Proxyserver m_hHttpOpen = InternetOpen(_T("ES2X ADSHW 3.05"), INTERNET_OPEN_TYPE_DIRECT, NULL, NULL, 0);
InternetConnect(m_hHttpOpen, m_HostName, INTERNET_DEFAULT_HTTP_PORT, NULL, NULL, INTERNET_SERVICE_HTTP, 0, 0);
// Add 2 SOAP related headers HttpAddRequestHeaders(hHttpRequest, m_szHdr[j], _tcslen(m_szHdr[j]), HTTP_ADDREQ_FLAG_REPLACE | HTTP_ADDREQ_FLAG_ADD);
// Open the request using a Proxyserver HttpOpenRequest(m_hHttpSession, _T("POST"), m_UrlPath, _T("HTTP/1.0"), NULL, NULL, INTERNET_FLAG_KEEP_CONNECTION | INTERNET_FLAG_DONT_CACHE, 0);
// Open the request NOT using a Proxyserver hHttpRequest = HttpOpenRequest(m_hHttpSession, _T("POST"), m_UrlPath, NULL, NULL, NULL, INTERNET_FLAG_DONT_CACHE, 0);
After that I create a new thread that will send the request. The main thread will wait for this new thread for a specified amount of time and will either close the handles if the new thread hasn't finished yet, reporting a timeout error, or it will read the response.
// Use Proxyserver InternetSetOption(Params->m_hHttpRequest, INTERNET_OPTION_PROXY_USERNAME, (void*)Params->m_UserName, _tcslen(Params->m_UserName) + 1); InternetSetOption(Params->m_hHttpRequest, INTERNET_OPTION_PROXY_PASSWORD, (void*)Params->m_Password, _tcslen(Params->m_Password) + 1);
HttpSendRequest(Params->m_hHttpRequest, NULL, 0, (LPVOID)Params->m_szData, strlen(Params->m_szData));
I have no idea where I'm loosing this 8kb and why it only happens when NOT using a proxy server.
Any help is greatly appreciated. |