IIS
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsSystem AdministrationIIS

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old February 19th, 2006, 12:47 AM
t_amar t_amar is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2006
Posts: 2 t_amar User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 24 m 29 sec
Reputation Power: 0
Unhappy IIS 5.0 Filter: Some data is lost in transport

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

Reply With Quote
  #2  
Old February 20th, 2006, 03:44 AM
mladenst mladenst is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2004
Posts: 16 mladenst User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 h 28 m 52 sec
Reputation Power: 0
Have you modified the Content-Length header?

If you make change to the size of the output, you should adjust this header, too.

Reply With Quote
  #3  
Old February 20th, 2006, 09:30 AM
t_amar t_amar is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2006
Posts: 2 t_amar User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 24 m 29 sec
Reputation Power: 0
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

Reply With Quote
Reply

Viewing: Dev Shed ForumsSystem AdministrationIIS > IIS 5.0 Filter: Some data is lost in transport


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway
Stay green...Green IT