locked
Issues with HttpEndRequest wininet api RRS feed

  • Question

  • Hello all,
    HttpEndRequest wininet api takes around 21 sec to exit.Below i've given my code snippet :
    hFile = HttpOpenRequest(hSession, TEXT("POST"), pUrlPath, HTTP_VERSION, TEXT(""), pszAcceptTypes, dwFlags, 0);
    //doing error check
    INTERNET_BUFFERS ibBuffer;
    ZeroMemory (& ibBuffer, sizeof (INTERNET_BUFFERS));
    ibBuffer.dwStructSize  = sizeof (INTERNET_BUFFERS);
    ibBuffer.dwBufferTotal = dwBufferSize;
    if ( !HttpSendRequestEx (hFile, &ibBuffer, NULL, HSR_INITIATE, 0))
     //doing error check

        while ( isUploading &&  (nBufferPos < dwBufferSize ))
        {
            if (! InternetWriteFile (hFile, pBufferPtr, nChunkSize, &dwBytesSend))
             pBufferPtr += nChunkSize;
             BufferPos += nChunkSize;
             if (dwBufferSize - nBufferPos < nChunkSize)
                nChunkSize = dwBufferSize - nBufferPos;   
             dataOperated +=  nChunkSize;
        }

    and then
    HttpEndRequest (hFile, NULL, 0, 0);

    please tell me why this api takes so much time in exiting.

    Thanks in advance.
    umesh
    Saturday, January 2, 2010 11:53 AM

All replies

  • any pointers or helps are most welcome :)
    Monday, January 4, 2010 9:04 AM
  • Hello All,
    I'm using BOOL HttpSendRequestEx( HINTERNET hRequest,   LPINTERNET_BUFFERS lpBuffersIn,   LPINTERNET_BUFFERS lpBuffersOut, DWORD dwFlags,   DWORD dwContext) for uploading data in chunks to my server. After upload completion i'm using BOOL HttpEndRequest(  HINTERNET hRequest,  LPINTERNET_BUFFERS lpBuffersOut,   DWORD dwFlags,  DWORD dwContext) to end request.
    Everything running fine but HttpEndRequest api takes 20 sec min to exit some time it takes 30 - 40 sec to exit.
    I'm clueless why it takes so much time to exit.......

    Thanks in advance :)
    • Merged by warrentang Friday, January 22, 2010 7:04 AM duplicate
    Saturday, January 16, 2010 7:21 AM