|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Dear all,
I wrote an IIS 5.0 filter using MFC and VC++ 6.0. This is an output/response filter i.e., it modifies response data. After modifying the data, I am writing the modifying data into a text file along with normal process. The issue is the text file is containing the data prefectly, but the data that I am receiving in my browser is missing some data in end. The client or browser machine and the server machine are two different machines in local network. Please help me. Thanks in advance, Amarendra nath |
|
#2
|
|||
|
|||
|
Have you modified the Content-Length header?
If you make change to the size of the output, you should adjust this header, too. |
|
#3
|
|||
|
|||
|
Hi mladenst,
Thanks for the information. Actually, this is the first time that I am writing an ISAPI filter....so not aware of all the things. Can you please tell me as to how do I do this....changing CONTENT-LENGTH HEADER. Here is my OnSendRawData() code DWORD CHTML2CHTMLFilter::OnSendRawData(CHttpFilterContext* pCtxt, PHTTP_FILTER_RAW_DATA pRawData) { LPTSTR pstrIn; DWORD cbBuffer; DWORD cbTemp; // if we previously identified the data requested as being // interesting, let's try to parse it if (pCtxt->m_pFC->pFilterContext != NULL) { // gain a pointer to the actual data pstrIn = (LPTSTR) pRawData->pvInData; cbBuffer = 0; cbTemp = 0; // are we waiting for the header? if (pCtxt->m_pFC->pFilterContext == (VOID *) 1) { // rip through the header to the end while (cbBuffer < pRawData->cbInData) { if (pstrIn[cbBuffer] == '\n' && pstrIn[cbBuffer+2] == '\n') { cbBuffer += 3; break; } cbBuffer++; } // does the header identify HTML content? while (cbTemp < cbBuffer) { if (pstrIn[cbTemp] == '/' && pstrIn[cbTemp+1] == 'h' && pstrIn[cbTemp+2] == 't' && pstrIn[cbTemp+3] == 'm') { // yes, it's HTML, set our flag pCtxt->m_pFC->pFilterContext = (VOID*) 2; break; } cbTemp++; } // if it wasn't HTML--clear the flag if (cbTemp == cbBuffer) pCtxt->m_pFC->pFilterContext = NULL; } CString strTemp, strResult; strTemp.Format("%s", pstrIn); strResult = TableToList(strTemp);// Content modifying function....increases the content size sprintf(pstrIn, "%s", "\0"); sprintf(pstrIn, "%s\0", strResult.GetBuffer(strResult.GetLength())); } return SF_STATUS_REQ_NEXT_NOTIFICATION; } ============================================ Thanks in advance, Amarendra nath Turaga |
![]() |
| Viewing: Dev Shed Forums > System Administration > IIS > IIS 5.0 Filter: Some data is lost in transport |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|