Welcome to MobyThreads.com!
FAQFAQ   SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log inLog in
All support for the MobyThreads Threaded phpBB MOD can now be found on welsolutions at this forum

IIS with ISAPI filter does not respond on load testing

 
   Web Hosting and Web Master Forums (Home) -> IIS RSS
Related Topics:
IIS manager don't want to load my ISAPI filter when done w.. - Of .net 2003 The same code works for VC++6. I always use the ISAPI wizzard. My ISAPI Extension works in VC++7 and VC++7. I use, ISS6 from Win 2003 server

problem with using ACT for load testing - Hello, I'm learning IIS and web and I have run into a problem, again. I have web pages running just fine, and they seem happy. So, I got to the chapter in the book about using Microsoft ACT for load testing, and decided that was a..

Recommendations invited. What tools do you use for Capacit.. - From the lack of response to my earlier enquiries it has become obvious that nobody uses WCAT utility, (or is prepared to admit they use it). We seem to have problems getting it to work except on one Website, and there we don't know what it..

ISAPI Filter in VB6 - Is it possible to write an ISAPI filter in VB6 (or VB.net for that matter). If so, how? Please? TIA, Owen

ISAPI filter - Hi! We are doing some to find new ways to develop out product in a couple of different areas. One way to go includes writing an ISAPI filter that before the ASP code gets parsed. The reason for doing this is that we want to handle..
Next:  Recycling the worker process for ASP 3.0 applicat..  
Author Message
gvrajkumar

External


Since: Jan 24, 2005
Posts: 1



(Msg. 1) Posted: Mon Jan 24, 2005 3:13 am
Post subject: IIS with ISAPI filter does not respond on load testing
Archived from groups: microsoft>public>inetserver>iis (more info?)

I have an ISAPI filter configured on an IIS server. The filter seems to
have a problem when it returns a 403(forbidden) on very large requests
(load 1MB post). Around the 43rd request the IIS stops responding to
the requests. There is no problem when the same 403 is returned on
smaller requests ( 5KB post, 30,000 requests). The same code(load 1MB
post OR 5KB pst, 30,000) works perfectly if the request goes through
with a 200. I have checked the code thoroughly for any memory leaks but
I cannot find any. Please find the code below. Any help would be
greatly appreciated.

#include <windows.h>
#include <httpfilt.h>
#include <fcntl.h>
#include <string.h>
#include <stdio.h>
typedef struct
{
char client_ip[20];
int processed; //Flag that tells if the request has been
processed so far or not
char data_request[3];
char * tmpCindata;
} request_Content;

BOOL WINAPI GetFilterVersion( PHTTP_FILTER_VERSION pVer )
{
pVer->dwFlags = SF_NOTIFY_ORDER_HIGH;
pVer->dwFilterVersion = MAKELONG( 0, 1 );
// Clear the flags set by base class
pVer->dwFlags &= ~SF_NOTIFY_ORDER_MASK;
strncpy(pVer->lpszFilterDesc, "******************",
SF_MAX_FILTER_DESC_LEN);

/* Ask to be notified at the authentication stage of every HTTP
request */
pVer->dwFlags = SF_NOTIFY_ORDER_HIGH |
SF_NOTIFY_READ_RAW_DATA | SF_NOTIFY_END_OF_REQUEST ;
return TRUE;
}

DWORD WINAPI HttpFilterProc( PHTTP_FILTER_CONTEXT pCtxt, DWORD
notificationType, LPVOID pvNotification )
{
request_Content *reqContent ; //Creates a request_Content structure
variable (one for each request)
//WriteEventLogEntry(portfrom,'4');
if(notificationType == SF_NOTIFY_READ_RAW_DATA)
{

PHTTP_FILTER_RAW_DATA pRawData = (PHTTP_FILTER_RAW_DATA)
pvNotification;
//define the structure for the hashmap for encoding...

//struct tmpdata tmpCin;
reqContent = (request_Content *) pCtxt->pFilterContext;

if (reqContent == NULL) //Initialize
{
reqContent = (request_Content *) malloc(sizeof(request_Content));
reqContent->processed = 0;
memset(reqContent->data_request, '\0',
strlen(reqContent->data_request));
// get the client IP
sprintf(reqContent->client_ip, "0");
DWORD dword1 = 20;

pCtxt->GetServerVariable(pCtxt, "REMOTE_HOST", reqContent->client_ip,
&dword1);
if(strstr(reqContent->client_ip,".") == NULL)
{sprintf(reqContent->client_ip, "0.0.0.0");}
pCtxt->pFilterContext = reqContent;
}

if((reqContent->processed > 0) || ((strstr((char
*)pRawData->pvInData,"\r\n\r\n")) != NULL))
{

reqContent->processed+=1;
if(strstr((char *)pRawData->pvInData,"</soap:Envelope>") != NULL)
{
//found the whole request body
//some process on the body content if not valid give 403 FORBIDDEN
pCtxt->ServerSupportFunction ( pCtxt,
SF_REQ_SEND_RESPONSE_HEADER,(LPVOID) "403 FORBIDEN",(DWORD)NULL,0 );
free(reqContent);
return SF_STATUS_REQ_FINISHED_KEEP_CONN;
}
else
{
return SF_STATUS_REQ_NEXT_NOTIFICATION;
}

}

return SF_STATUS_REQ_NEXT_NOTIFICATION;
}
else if(notificationType == SF_NOTIFY_END_OF_REQUEST)
{
//reqContent = (request_Content *) pCtxt->pFilterContext;
free(reqContent);
return SF_STATUS_REQ_NEXT_NOTIFICATION;
}
else
{
return SF_STATUS_REQ_NEXT_NOTIFICATION;
}
  return SF_STATUS_REQ_NEXT_NOTIFICATION;
}

Venkat<!-- ~MESSAGE_AFTER~ -->

 >> Stay informed about: IIS with ISAPI filter does not respond on load testing 
Back to top
Login to vote
someone9

External


Since: Aug 25, 2003
Posts: 2419



(Msg. 2) Posted: Mon Jan 24, 2005 1:53 pm
Post subject: Re: IIS with ISAPI filter does not respond on load testing [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Please do not multipost. Answered in
microsoft.public.platformsdk.internet.server.isapi-dev

Basically, this filter is making incorrect assumptions and causing IIS
hangs.

--
//David
IIS
http://blogs.msdn.com/David.Wang
This posting is provided "AS IS" with no warranties, and confers no rights.
//
<gvrajkumar DeleteThis @gmail.com> wrote in message
news:1106565227.737370.206220@c13g2000cwb.googlegroups.com...
I have an ISAPI filter configured on an IIS server. The filter seems to
have a problem when it returns a 403(forbidden) on very large requests
(load 1MB post). Around the 43rd request the IIS stops responding to
the requests. There is no problem when the same 403 is returned on
smaller requests ( 5KB post, 30,000 requests). The same code(load 1MB
post OR 5KB pst, 30,000) works perfectly if the request goes through
with a 200. I have checked the code thoroughly for any memory leaks but
I cannot find any. Please find the code below. Any help would be
greatly appreciated.

#include <windows.h>
#include <httpfilt.h>
#include <fcntl.h>
#include <string.h>
#include <stdio.h>
typedef struct
{
char client_ip[20];
int processed; //Flag that tells if the request has been
processed so far or not
char data_request[3];
char * tmpCindata;
} request_Content;

BOOL WINAPI GetFilterVersion( PHTTP_FILTER_VERSION pVer )
{
pVer->dwFlags = SF_NOTIFY_ORDER_HIGH;
pVer->dwFilterVersion = MAKELONG( 0, 1 );
// Clear the flags set by base class
pVer->dwFlags &= ~SF_NOTIFY_ORDER_MASK;
strncpy(pVer->lpszFilterDesc, "******************",
SF_MAX_FILTER_DESC_LEN);

/* Ask to be notified at the authentication stage of every HTTP
request */
pVer->dwFlags = SF_NOTIFY_ORDER_HIGH |
SF_NOTIFY_READ_RAW_DATA | SF_NOTIFY_END_OF_REQUEST ;
return TRUE;
}

DWORD WINAPI HttpFilterProc( PHTTP_FILTER_CONTEXT pCtxt, DWORD
notificationType, LPVOID pvNotification )
{
request_Content *reqContent ; //Creates a request_Content structure
variable (one for each request)
//WriteEventLogEntry(portfrom,'4');
if(notificationType == SF_NOTIFY_READ_RAW_DATA)
{

PHTTP_FILTER_RAW_DATA pRawData = (PHTTP_FILTER_RAW_DATA)
pvNotification;
//define the structure for the hashmap for encoding...

//struct tmpdata tmpCin;
reqContent = (request_Content *) pCtxt->pFilterContext;

if (reqContent == NULL) //Initialize
{
reqContent = (request_Content *) malloc(sizeof(request_Content));
reqContent->processed = 0;
memset(reqContent->data_request, '\0',
strlen(reqContent->data_request));
// get the client IP
sprintf(reqContent->client_ip, "0");
DWORD dword1 = 20;

pCtxt->GetServerVariable(pCtxt, "REMOTE_HOST", reqContent->client_ip,
&dword1);
if(strstr(reqContent->client_ip,".") == NULL)
{sprintf(reqContent->client_ip, "0.0.0.0");}
pCtxt->pFilterContext = reqContent;
}

if((reqContent->processed > 0) || ((strstr((char
*)pRawData->pvInData,"\r\n\r\n")) != NULL))
{

reqContent->processed+=1;
if(strstr((char *)pRawData->pvInData,"</soap:Envelope>") != NULL)
{
//found the whole request body
//some process on the body content if not valid give 403 FORBIDDEN
pCtxt->ServerSupportFunction ( pCtxt,
SF_REQ_SEND_RESPONSE_HEADER,(LPVOID) "403 FORBIDEN",(DWORD)NULL,0 );
free(reqContent);
return SF_STATUS_REQ_FINISHED_KEEP_CONN;
}
else
{
return SF_STATUS_REQ_NEXT_NOTIFICATION;
}

}

return SF_STATUS_REQ_NEXT_NOTIFICATION;
}
else if(notificationType == SF_NOTIFY_END_OF_REQUEST)
{
//reqContent = (request_Content *) pCtxt->pFilterContext;
free(reqContent);
return SF_STATUS_REQ_NEXT_NOTIFICATION;
}
else
{
return SF_STATUS_REQ_NEXT_NOTIFICATION;
}
return SF_STATUS_REQ_NEXT_NOTIFICATION;
}

Venkat

 >> Stay informed about: IIS with ISAPI filter does not respond on load testing 
Back to top
Login to vote
Display posts from previous:   
   Web Hosting and Web Master Forums (Home) -> IIS All times are: Pacific Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]