Quantcast
Channel: All Forums
Viewing all articles
Browse latest Browse all 27852

C++ module, ReadEntityBody 0 bytes error 0x80070006

$
0
0

Hi All

We are using C++ native module to successfully process web requests out of IIS into our custom architecture, but we have a strangle issue effecting this system.

We are handling OnBeginRequest and using GetRemainingEntityBytes to check for post data and ReadEntityBody to retrieve this data.

Sometimes GetRemainingEntityBytes will correctly show there is data available, but ReadEntityBody will return 0 bytes and give the error 0x80070006

Most vexingly this is only occuring after midnight GMT for about an hour and but will go away after an IIS reboot. Seems to happen only for browser based requests, with curl for example it seems it doesnt happen.

Often the entire post data is missing, but sometimes do get some of the data. We are mostly posting formpost/multipart if that helps.

Code sample of our read loop below;

    DWORD cbBytesReceived = Request->GetRemainingEntityBytes();
    CString TxData;
    bool Success=((cbBytesReceived>=0)&&(cbBytesReceived<MaxRequestLength));
    while((cbBytesReceived>0)&&Success)
       {CString TxDataBlock;
        char* Ptr=TxDataBlock.GetBuffer(cbBytesReceived);
        DWORD cbBytesReceived2 = cbBytesReceived;
        cbBytesReceived = 0;
        HRESULT hr = Request->ReadEntityBody(Ptr,cbBytesReceived2,false,&cbBytesReceived,NULL);

       Success=(hr>=0);
        if(Success)
        {
            TxDataBlock.ReleaseBuffer(cbBytesReceived);
        }  
        else
        {
 
            TxDataBlock.ReleaseBufferSetLength(0);

}

        TxData.Append(TxDataBlock);
        cbBytesReceived = Request->GetRemainingEntityBytes();

       }

Any ideas would be very appreciated. We are running IIS7.5, The application pool as 'no managed code' , 'Classic'. Not sure if any other settings are of interest..

thanks


Viewing all articles
Browse latest Browse all 27852

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>