Welcome to HostingForumz.com!
FAQFAQ   SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

IIS with ISAPI filter does not respond on load testing

 
   Web Hosting Problem Solving Community! (Home) -> IIS RSS
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.TakeThisOut@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 Problem Solving Community! (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 ]