locked
ISAPI Extension takes long time to read the http request body RRS feed

  • Question

  • User-2069584892 posted
    Alert me
    |
    Edit
    |
    Change type
    Question
    You cannot vote on your own post
    0
    Hi

    We have an isapi extensiom that supports get and post. we are experiecing slow ness
    while posting the large data to server for example 16 to 20 MB

    we are using the ReadClient method in loop to and sending  the data as shown in below code

    if(pECB->cbAvailable)
    {
       totalReadBytes -= newConnection->SendData(pECB->lpbData, pECB->cbAvailable);
    }

    while(totalReadBytes > 0 || readUntilEndOfStream)
                        
    {
        if(!tempBuffer) tempBuffer =  new unsigned char[totalBytes];

        if(!pECB->ReadClient(pECB->ConnID, tempBuffer, &totalBytes)) break;

        if(!totalBytes) break;
       
       if(!newConnection->SendData(tempBuffer, totalBytes)) break;

       totalReadBytes -= totalBytes;
    }

    The above ReadClient read the request body  in 16*1024 chaunks till it reads all the data
    due to this it will loop 100o time to send all the data . due to this it's very slow to upload the large data

    we are fine to upload the small files like 120 KB etc. it's very fast to do this but when come to huge files we are facing this issue


    Can anyone help us with this issue. Why the readcliient is always reading 16* 1024 bytes per call.Can't we increase this?

    Thanks & Regards
    Sukumar
    Thursday, August 28, 2014 1:39 AM

Answers

  • User-1818759697 posted

    Hi,

    Can anyone help us with this issue. Why the readcliient is always reading 16* 1024 bytes per call.Can't we increase this?

    For this situation, please refer to the following information:

    Some options are new in the ISAPI handler since server version 1.1:

    • If you tried to read more bytes than pECB.cbTotalBytes ReadClient never returned. With Pi3Web 1.1 you can read exact cbTotalBytes in total.
    • Problem: The pECB.cbTotalBytes holds often 2 bytes less than the server received. Some browsers seem to send an additional CR/LF outside of the Content-Length. The 'flag="BuggyContentLength"' in the ISAPI handler object fixes this.
    • A parameter 'ReadBufferSize=<bytes> was added to set the initial read size. This is 16 kByte by default. Setting it to about 40 kByte should emulate most other servers.
    • The 'flag="NoBuffering"' was added to avoid that calls of WriteClient down the socket.

    http://pi3web.sourceforge.net/support/howto/HandleLargeData-1.html

    Regards

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, August 28, 2014 10:38 PM