Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
platform
active.directory
adsi
adsi.iis-admin
base
com_ole
complus_mts
component_svcs
database
directx
gdi
graphics_mm
internet.client
internet.server
internet.server.isapi-dev
localization
mapi
messaging
msi
mslayerforunicode
multimedia
networking
networking.ipv6
sdk_install
security
shell
telephony.tapi_2
telephony.tapi_3
telephony.tsp
telephony.wte
tools
ui
ui_shell
win_base_svcs
win16
  
 
date: Fri, 20 Jun 2008 06:43:02 -0700,    group: microsoft.public.platformsdk.internet.server.isapi-dev        back       


Get Header in OnReadRawData? (MFC)   
Hello,

I've read that the SF_NOTIFY_READ_RAW_DATA notification can occur more than 
once. At the first occourance of SF_NOTIFY_READ_RAW_DATA I add a response 
header. I want to make sure not to add the header more often. Isn't there 
something like GetHeader to find out, if the header has already been added?

Thanks for answers in advance!
Heinz
date: Fri, 20 Jun 2008 06:43:02 -0700   author:   Heinz

Re: Get Header in OnReadRawData? (MFC)   
On Jun 20, 6:43 am, Heinz  wrote:
> Hello,
>
> I've read that the SF_NOTIFY_READ_RAW_DATA notification can occur more than
> once. At the first occourance of SF_NOTIFY_READ_RAW_DATA I add a response
> header. I want to make sure not to add the header more often. Isn't there
> something like GetHeader to find out, if the header has already been added?
>
> Thanks for answers in advance!
> Heinz


You need to maintain per-request state to be able to do something like
this. There is no built-in mechanism for per-request state.
pFilterContext is the built-in mechanism for per-connection state.

However, GetHeader() will not retrieve the value of
AddResponseHeader(), so that approach will not work.

Depending on the IIS version for the ISAPI Filter, using
SF_NOTIFY_READ_RAW_DATA and adding response header almost certainly
mean the wrong architecture, so you may have more problems than you
think.


//David
http://w3-4u.blogspot.com
http://blogs.msdn.com/David.Wang
//
date: Sun, 22 Jun 2008 20:05:47 -0700 (PDT)   author:   David Wang

Re: Get Header in OnReadRawData? (MFC)   
Thanks for your answer David. So what would be your advice? I need the 
Information when request arrives at the server and when the response leaves 
and I have to add this informatin to the response as a header.

What I'm currently doing is: I get the system time when 
SF_NOTIFY_READ_RAW_DATA occours and add it as a header. When the 
SF_NOTIFY_SEND_RESPONSE notification occours I get the the system time again  
and add it to the same header. It works for IIS 5 but it also has to work on 
IIS 6.

This is what the response header looks linke:
   IISTimestamps: 299410101710235842 299410101711172634

So what should I do instead of using the SF_NOTIFY_READ_RAW_DATA 
notification? (I read there might be problems using this notification in IIS 
6)

Thanks,
Heinz
date: Thu, 3 Jul 2008 06:45:02 -0700   author:   Heinz

Re: Get Header in OnReadRawData? (MFC)   
On Jul 3, 6:45 am, Heinz  wrote:
> Thanks for your answer David. So what would be your advice? I need the
> Information when request arrives at the server and when the response leaves
> and I have to add this informatin to the response as a header.
>
> What I'm currently doing is: I get the system time when
> SF_NOTIFY_READ_RAW_DATA occours and add it as a header. When the
> SF_NOTIFY_SEND_RESPONSE notification occours I get the the system time again  
> and add it to the same header. It works for IIS 5 but it also has to work on
> IIS 6.
>
> This is what the response header looks linke:
>    IISTimestamps: 299410101710235842 299410101711172634
>
> So what should I do instead of using the SF_NOTIFY_READ_RAW_DATA
> notification? (I read there might be problems using this notification in IIS
> 6)
>
> Thanks,
> Heinz


You will need to describe why your filter is listening on
SF_NOTIFY_READ_RAW_DATA and trying to pass data to
SF_NOTIFY_SEND_RESPONSE in order for anyone to correctly assist you.


//David
http://w3-4u.blogspot.com
http://blogs.msdn.com/David.Wang
//
date: Thu, 3 Jul 2008 13:41:23 -0700 (PDT)   author:   David Wang

Re: Get Header in OnReadRawData? (MFC)   
Okay let me try it again. Maybe my Enlish is too bad...

When there comes a request for a site that runs on the IIS I'm working on, 
the request has to go through a lot of servers (firewall, load balancer, 
single sign on server, ... , and a load balancer again) until it reaches my 
maschine. My department is responsible for the performance of all that and 
thus we do some statistics on that topic. My job is to get the timestamps 
when the request reaches the IIS and when the response leaves. These two 
timestamps have to be added to the response as one header.

That's what I did to do this: I wrote an ISAPI Filter that listens on 
SF_NOTIFY_READ_RAW_DATA to get the incoming timestamp. I add the timestamp to 
the Headers using AddResponseHeader(). The Filter also listens on 
SF_NOTIFY_SEND_RESPONSE to get the outgoing timestamp. I use GetHeader() to 
get the first timestamp and then I add both timestamp as one header to the 
request using SetHeader().

My problems are now:
1. When SF_NOTIFY_READ_RAW_DATA occours more than once, the incoming 
timestamp will be overwritten - which is not what I want.
2. I read that SF_NOTIFY_READ_RAW_DATA will not work on IIS 6 (I've tested 
it on IIS 5 only so far).

So my question is now: How do I get the first timestamp when I don't use 
SF_NOTIFY_READ_RAW_DATA? How can I make sure to get it only once? And how can 
I make the first timespamp available in SF_NOTIFY_SEND_RESPONSE?

I hope this is what you need :-)

Thanks,
Heinz




"David Wang" wrote:


> On Jul 3, 6:45 am, Heinz  wrote:
> > Thanks for your answer David. So what would be your advice? I need the
> > Information when request arrives at the server and when the response leaves
> > and I have to add this informatin to the response as a header.
> >
> > What I'm currently doing is: I get the system time when
> > SF_NOTIFY_READ_RAW_DATA occours and add it as a header. When the
> > SF_NOTIFY_SEND_RESPONSE notification occours I get the the system time again  
> > and add it to the same header. It works for IIS 5 but it also has to work on
> > IIS 6.
> >
> > This is what the response header looks linke:
> >    IISTimestamps: 299410101710235842 299410101711172634
> >
> > So what should I do instead of using the SF_NOTIFY_READ_RAW_DATA
> > notification? (I read there might be problems using this notification in IIS
> > 6)
> >
> > Thanks,
> > Heinz
> 
> 
> You will need to describe why your filter is listening on
> SF_NOTIFY_READ_RAW_DATA and trying to pass data to
> SF_NOTIFY_SEND_RESPONSE in order for anyone to correctly assist you.
> 
> 
> //David
> http://w3-4u.blogspot.com
> http://blogs.msdn.com/David.Wang
> //
>
date: Fri, 4 Jul 2008 05:34:00 -0700   author:   Heinz

Re: Get Header in OnReadRawData? (MFC)   
Are you required to get timestamps on the actual test request, or are
you required to know how long the test request took.

Because IIS6 has ETW Tracing, which can be processed to give perfect
request processing time for any request, not just test requests.

Or you can add the header in SF_NOTIFY_PREPROC_HEADERS (instead of
SF_NOTIFY_READ_RAW_DATA), which is guaranteed to be only called once
per request and happens right after IIS reads in all the raw data but
before IIS starts parsing and processing the request. This code would
work on IIS5 and IIS6 in all modes.


//David
http://w3-4u.blogspot.com
http://blogs.msdn.com/David.Wang
//




On Jul 4, 5:34 am, Heinz  wrote:
> Okay let me try it again. Maybe my Enlish is too bad...
>
> When there comes a request for a site that runs on the IIS I'm working on> the request has to go through a lot of servers (firewall, load balancer,
> single sign on server, ... , and a load balancer again) until it reaches my
> maschine. My department is responsible for the performance of all that and
> thus we do some statistics on that topic. My job is to get the timestamps
> when the request reaches the IIS and when the response leaves. These two
> timestamps have to be added to the response as one header.
>
> That's what I did to do this: I wrote an ISAPI Filter that listens on
> SF_NOTIFY_READ_RAW_DATA to get the incoming timestamp. I add the timestamp to
> the Headers using AddResponseHeader(). The Filter also listens on
> SF_NOTIFY_SEND_RESPONSE to get the outgoing timestamp. I use GetHeader() to
> get the first timestamp and then I add both timestamp as one header to the
> request using SetHeader().
>
> My problems are now:
> 1. When SF_NOTIFY_READ_RAW_DATA occours more than once, the incoming
> timestamp will be overwritten - which is not what I want.
> 2. I read that SF_NOTIFY_READ_RAW_DATA will not work on IIS 6 (I've tested
> it on IIS 5 only so far).
>
> So my question is now: How do I get the first timestamp when I don't use
> SF_NOTIFY_READ_RAW_DATA? How can I make sure to get it only once? And how can
> I make the first timespamp available in SF_NOTIFY_SEND_RESPONSE?
>
> I hope this is what you need :-)
>
> Thanks,
> Heinz
>
>
>
> "David Wang" wrote:
> > On Jul 3, 6:45 am, Heinz  wrote:
> > > Thanks for your answer David. So what would be your advice? I need the
> > > Information when request arrives at the server and when the response leaves
> > > and I have to add this informatin to the response as a header.
>
> > > What I'm currently doing is: I get the system time when
> > > SF_NOTIFY_READ_RAW_DATA occours and add it as a header. When the
> > > SF_NOTIFY_SEND_RESPONSE notification occours I get the the system time again  
> > > and add it to the same header. It works for IIS 5 but it also has to work on
> > > IIS 6.
>
> > > This is what the response header looks linke:
> > >    IISTimestamps: 299410101710235842 299410101711172634
>
> > > So what should I do instead of using the SF_NOTIFY_READ_RAW_DATA
> > > notification? (I read there might be problems using this notification in IIS
> > > 6)
>
> > > Thanks,
> > > Heinz
>
> > You will need to describe why your filter is listening on
> > SF_NOTIFY_READ_RAW_DATA and trying to pass data to
> > SF_NOTIFY_SEND_RESPONSE in order for anyone to correctly assist you.
>
> > //David
> >http://w3-4u.blogspot.com
> >http://blogs.msdn.com/David.Wang
> > //- Hide quoted text -
>
> - Show quoted text -
date: Mon, 7 Jul 2008 23:40:16 -0700 (PDT)   author:   David Wang

Re: Get Header in OnReadRawData? (MFC)   
Thanks for your advise. I'm required to get the timestamps for each request. 
I'm using SF_NOTIFY_PREPROC_HEADERS instead of SF_NOTIFY_READ_RAW_DATA now. 

I've just tested my ISAPI filter on IIS 6. SF_NOTIFY_PREPROC_HEADERS works 
fine. But I'm a little bit confused now because it seems that 
SF_NOTIFY_SEND_RESPONSE does not work on IIS 6. The only line of code I have 
in that notification is:
	psr->AddHeader(pfc->m_pFC, "TestHeader:", "TestValue\r\n");
Either the notification or this line does not work.

Do you have any suggestions?

Thanks,
Heinz


"David Wang" wrote:

> Are you required to get timestamps on the actual test request, or are
> you required to know how long the test request took.
> 
> Because IIS6 has ETW Tracing, which can be processed to give perfect
> request processing time for any request, not just test requests.
> 
> Or you can add the header in SF_NOTIFY_PREPROC_HEADERS (instead of
> SF_NOTIFY_READ_RAW_DATA), which is guaranteed to be only called once
> per request and happens right after IIS reads in all the raw data but
> before IIS starts parsing and processing the request. This code would
> work on IIS5 and IIS6 in all modes.
> 
> 
> //David
> http://w3-4u.blogspot.com
> http://blogs.msdn.com/David.Wang
> //
> 
> 
> 
> 
> On Jul 4, 5:34 am, Heinz  wrote:
> > Okay let me try it again. Maybe my Enlish is too bad...
> >
> > When there comes a request for a site that runs on the IIS I'm working on,
> > the request has to go through a lot of servers (firewall, load balancer,
> > single sign on server, ... , and a load balancer again) until it reaches my
> > maschine. My department is responsible for the performance of all that and
> > thus we do some statistics on that topic. My job is to get the timestamps
> > when the request reaches the IIS and when the response leaves. These two
> > timestamps have to be added to the response as one header.
> >
> > That's what I did to do this: I wrote an ISAPI Filter that listens on
> > SF_NOTIFY_READ_RAW_DATA to get the incoming timestamp. I add the timestamp to
> > the Headers using AddResponseHeader(). The Filter also listens on
> > SF_NOTIFY_SEND_RESPONSE to get the outgoing timestamp. I use GetHeader() to
> > get the first timestamp and then I add both timestamp as one header to the
> > request using SetHeader().
> >
> > My problems are now:
> > 1. When SF_NOTIFY_READ_RAW_DATA occours more than once, the incoming
> > timestamp will be overwritten - which is not what I want.
> > 2. I read that SF_NOTIFY_READ_RAW_DATA will not work on IIS 6 (I've tested
> > it on IIS 5 only so far).
> >
> > So my question is now: How do I get the first timestamp when I don't use
> > SF_NOTIFY_READ_RAW_DATA? How can I make sure to get it only once? And how can
> > I make the first timespamp available in SF_NOTIFY_SEND_RESPONSE?
> >
> > I hope this is what you need :-)
> >
> > Thanks,
> > Heinz
> >
> >
> >
> > "David Wang" wrote:
> > > On Jul 3, 6:45 am, Heinz  wrote:
> > > > Thanks for your answer David. So what would be your advice? I need the
> > > > Information when request arrives at the server and when the response leaves
> > > > and I have to add this informatin to the response as a header.
> >
> > > > What I'm currently doing is: I get the system time when
> > > > SF_NOTIFY_READ_RAW_DATA occours and add it as a header. When the
> > > > SF_NOTIFY_SEND_RESPONSE notification occours I get the the system time again  
> > > > and add it to the same header. It works for IIS 5 but it also has to work on
> > > > IIS 6.
> >
> > > > This is what the response header looks linke:
> > > >    IISTimestamps: 299410101710235842 299410101711172634
> >
> > > > So what should I do instead of using the SF_NOTIFY_READ_RAW_DATA
> > > > notification? (I read there might be problems using this notification in IIS
> > > > 6)
> >
> > > > Thanks,
> > > > Heinz
> >
> > > You will need to describe why your filter is listening on
> > > SF_NOTIFY_READ_RAW_DATA and trying to pass data to
> > > SF_NOTIFY_SEND_RESPONSE in order for anyone to correctly assist you.
> >
> > > //David
> > >http://w3-4u.blogspot.com
> > >http://blogs.msdn.com/David.Wang
> > > //- Hide quoted text -
> >
> > - Show quoted text -
>
date: Fri, 18 Jul 2008 05:54:17 -0700   author:   Heinz

Re: Get Header in OnReadRawData? (MFC)   
You cannot AddHeader with \r\n

Also, not all responses generate SF_NOTIFY_SEND_RESPONSE. Since IIS
does not parse output data, only structured responses generate that
event. i.e. if you have an ISAPI which only used WriteClient() to
generate the response, there will be no SF_NOTIFY_SEND_RESPONSE for
that request/response pair.


//David
http://w3-4u.blogspot.com
http://blogs.msdn.com/David.Wang
//



On Jul 18, 5:54 am, Heinz  wrote:
> Thanks for your advise. I'm required to get the timestamps for each request.
> I'm using SF_NOTIFY_PREPROC_HEADERS instead of SF_NOTIFY_READ_RAW_DATA now.
>
> I've just tested my ISAPI filter on IIS 6. SF_NOTIFY_PREPROC_HEADERS works
> fine. But I'm a little bit confused now because it seems that
> SF_NOTIFY_SEND_RESPONSE does not work on IIS 6. The only line of code I have
> in that notification is:
>         psr->AddHeader(pfc->m_pFC, "TestHeader:", "TestValue\r\n"> Either the notification or this line does not work.
>
> Do you have any suggestions?
>
> Thanks,
> Heinz
>
>
>
> "David Wang" wrote:
> > Are you required to get timestamps on the actual test request, or are
> > you required to know how long the test request took.
>
> > Because IIS6 has ETW Tracing, which can be processed to give perfect
> > request processing time for any request, not just test requests.
>
> > Or you can add the header in SF_NOTIFY_PREPROC_HEADERS (instead of
> > SF_NOTIFY_READ_RAW_DATA), which is guaranteed to be only called once
> > per request and happens right after IIS reads in all the raw data but
> > before IIS starts parsing and processing the request. This code would
> > work on IIS5 and IIS6 in all modes.
>
> > //David
> >http://w3-4u.blogspot.com
> >http://blogs.msdn.com/David.Wang
> > //
>
> > On Jul 4, 5:34 am, Heinz  wrote:
> > > Okay let me try it again. Maybe my Enlish is too bad...
>
> > > When there comes a request for a site that runs on the IIS I'm working on,
> > > the request has to go through a lot of servers (firewall, load balancer,
> > > single sign on server, ... , and a load balancer again) until it reaches my
> > > maschine. My department is responsible for the performance of all that and
> > > thus we do some statistics on that topic. My job is to get the timestamps
> > > when the request reaches the IIS and when the response leaves. These two
> > > timestamps have to be added to the response as one header.
>
> > > That's what I did to do this: I wrote an ISAPI Filter that listens on
> > > SF_NOTIFY_READ_RAW_DATA to get the incoming timestamp. I add the timestamp to
> > > the Headers using AddResponseHeader(). The Filter also listens on
> > > SF_NOTIFY_SEND_RESPONSE to get the outgoing timestamp. I use GetHeader() to
> > > get the first timestamp and then I add both timestamp as one header to the
> > > request using SetHeader().
>
> > > My problems are now:
> > > 1. When SF_NOTIFY_READ_RAW_DATA occours more than once, the incoming
> > > timestamp will be overwritten - which is not what I want.
> > > 2. I read that SF_NOTIFY_READ_RAW_DATA will not work on IIS 6 (I've tested
> > > it on IIS 5 only so far).
>
> > > So my question is now: How do I get the first timestamp when I don't use
> > > SF_NOTIFY_READ_RAW_DATA? How can I make sure to get it only once? And how can
> > > I make the first timespamp available in SF_NOTIFY_SEND_RESPONSE?
>
> > > I hope this is what you need :-)
>
> > > Thanks,
> > > Heinz
>
> > > "David Wang" wrote:
> > > > On Jul 3, 6:45 am, Heinz  wrote:
> > > > > Thanks for your answer David. So what would be your advice? I need the
> > > > > Information when request arrives at the server and when the response leaves
> > > > > and I have to add this informatin to the response as a header.
>
> > > > > What I'm currently doing is: I get the system time when
> > > > > SF_NOTIFY_READ_RAW_DATA occours and add it as a header. When the
> > > > > SF_NOTIFY_SEND_RESPONSE notification occours I get the the system time again  
> > > > > and add it to the same header. It works for IIS 5 but it also has to work on
> > > > > IIS 6.
>
> > > > > This is what the response header looks linke:
> > > > >    IISTimestamps: 299410101710235842 299410101711172634
>
> > > > > So what should I do instead of using the SF_NOTIFY_READ_RAW_DATA
> > > > > notification? (I read there might be problems using this notification in IIS
> > > > > 6)
>
> > > > > Thanks,
> > > > > Heinz
>
> > > > You will need to describe why your filter is listening on
> > > > SF_NOTIFY_READ_RAW_DATA and trying to pass data to
> > > > SF_NOTIFY_SEND_RESPONSE in order for anyone to correctly assist you> > > > //David
> > > >http://w3-4u.blogspot.com
> > > >http://blogs.msdn.com/David.Wang
> > > > //- Hide quoted text -
>
> > > - Show quoted text -- Hide quoted text -
>
> - Show quoted text -
date: Fri, 18 Jul 2008 18:21:34 -0700 (PDT)   author:   David Wang

Re: Get Header in OnReadRawData? (MFC)   
"David Wang" wrote:

> You cannot AddHeader with \r\n

ah... thanks, terrible copy/paste mistake...
 
> Also, not all responses generate SF_NOTIFY_SEND_RESPONSE. Since IIS
> does not parse output data, only structured responses generate that
> event. i.e. if you have an ISAPI which only used WriteClient() to
> generate the response, there will be no SF_NOTIFY_SEND_RESPONSE for
> that request/response pair.
> 

SF_NOTIFY_SEND_RESPONSE seems to works for  all of my applications, but I 
keep that in mind. 

One general question: Is there a good documentation for ISAPI development? I 
know there are descriptions for methods and notifications and of course I use 
them, but is there a more detailed guide to learn ISAPI development? I don't 
want to have to ask you each question that occours - and there are a lot ;-)

Thanks very much for answering my questions.
Heinz

>
> //David
> http://w3-4u.blogspot.com
> http://blogs.msdn.com/David.Wang
> //
> 
> 
> 
> On Jul 18, 5:54 am, Heinz  wrote:
> > Thanks for your advise. I'm required to get the timestamps for each request.
> > I'm using SF_NOTIFY_PREPROC_HEADERS instead of SF_NOTIFY_READ_RAW_DATA now.
> >
> > I've just tested my ISAPI filter on IIS 6. SF_NOTIFY_PREPROC_HEADERS works
> > fine. But I'm a little bit confused now because it seems that
> > SF_NOTIFY_SEND_RESPONSE does not work on IIS 6. The only line of code I have
> > in that notification is:
> >         psr->AddHeader(pfc->m_pFC, "TestHeader:", "TestValue\r\n");
> > Either the notification or this line does not work.
> >
> > Do you have any suggestions?
> >
> > Thanks,
> > Heinz
> >
> >
> >
> > "David Wang" wrote:
> > > Are you required to get timestamps on the actual test request, or are
> > > you required to know how long the test request took.
> >
> > > Because IIS6 has ETW Tracing, which can be processed to give perfect
> > > request processing time for any request, not just test requests.
> >
> > > Or you can add the header in SF_NOTIFY_PREPROC_HEADERS (instead of
> > > SF_NOTIFY_READ_RAW_DATA), which is guaranteed to be only called once
> > > per request and happens right after IIS reads in all the raw data but
> > > before IIS starts parsing and processing the request. This code would
> > > work on IIS5 and IIS6 in all modes.
> >
> > > //David
> > >http://w3-4u.blogspot.com
> > >http://blogs.msdn.com/David.Wang
> > > //
> >
> > > On Jul 4, 5:34 am, Heinz  wrote:
> > > > Okay let me try it again. Maybe my Enlish is too bad...
> >
> > > > When there comes a request for a site that runs on the IIS I'm working on,
> > > > the request has to go through a lot of servers (firewall, load balancer,
> > > > single sign on server, ... , and a load balancer again) until it reaches my
> > > > maschine. My department is responsible for the performance of all that and
> > > > thus we do some statistics on that topic. My job is to get the timestamps
> > > > when the request reaches the IIS and when the response leaves. These two
> > > > timestamps have to be added to the response as one header.
> >
> > > > That's what I did to do this: I wrote an ISAPI Filter that listens on
> > > > SF_NOTIFY_READ_RAW_DATA to get the incoming timestamp. I add the timestamp to
> > > > the Headers using AddResponseHeader(). The Filter also listens on
> > > > SF_NOTIFY_SEND_RESPONSE to get the outgoing timestamp. I use GetHeader() to
> > > > get the first timestamp and then I add both timestamp as one header to the
> > > > request using SetHeader().
> >
> > > > My problems are now:
> > > > 1. When SF_NOTIFY_READ_RAW_DATA occours more than once, the incoming
> > > > timestamp will be overwritten - which is not what I want.
> > > > 2. I read that SF_NOTIFY_READ_RAW_DATA will not work on IIS 6 (I've tested
> > > > it on IIS 5 only so far).
> >
> > > > So my question is now: How do I get the first timestamp when I don't use
> > > > SF_NOTIFY_READ_RAW_DATA? How can I make sure to get it only once? And how can
> > > > I make the first timespamp available in SF_NOTIFY_SEND_RESPONSE?
> >
> > > > I hope this is what you need :-)
> >
> > > > Thanks,
> > > > Heinz
> >
> > > > "David Wang" wrote:
> > > > > On Jul 3, 6:45 am, Heinz  wrote:
> > > > > > Thanks for your answer David. So what would be your advice? I need the
> > > > > > Information when request arrives at the server and when the response leaves
> > > > > > and I have to add this informatin to the response as a header.
> >
> > > > > > What I'm currently doing is: I get the system time when
> > > > > > SF_NOTIFY_READ_RAW_DATA occours and add it as a header. When the
> > > > > > SF_NOTIFY_SEND_RESPONSE notification occours I get the the system time again  
> > > > > > and add it to the same header. It works for IIS 5 but it also has to work on
> > > > > > IIS 6.
> >
> > > > > > This is what the response header looks linke:
> > > > > >    IISTimestamps: 299410101710235842 299410101711172634
> >
> > > > > > So what should I do instead of using the SF_NOTIFY_READ_RAW_DATA
> > > > > > notification? (I read there might be problems using this notification in IIS
> > > > > > 6)
> >
> > > > > > Thanks,
> > > > > > Heinz
> >
> > > > > You will need to describe why your filter is listening on
> > > > > SF_NOTIFY_READ_RAW_DATA and trying to pass data to
> > > > > SF_NOTIFY_SEND_RESPONSE in order for anyone to correctly assist you..
> >
> > > > > //David
> > > > >http://w3-4u.blogspot.com
> > > > >http://blogs.msdn.com/David.Wang
> > > > > //- Hide quoted text -
> >
> > > > - Show quoted text -- Hide quoted text -
> >
> > - Show quoted text -
> 
>
date: Tue, 22 Jul 2008 05:22:00 -0700   author:   Heinz

Re: Get Header in OnReadRawData? (MFC)   
I really don't know of a detailed guide to learn ISAPI development. I
was fortunate enough to learn ISAPI from the ISAPI developer himself,
along with a whole lot of personal experimentation and effort.

I try to capture many answers to people's common ISAPI questions on my
MSDN blog, so feel free to ask questions, and it will likely become a
blog entry or two. I still have a lot of outstanding topics to blog
about; I just need to find the time as well as people's motivating
questions to do it.


//David
http://w3-4u.blogspot.com
http://blogs.msdn.com/David.Wang
//




On Jul 22, 5:22 am, Heinz  wrote:
> "David Wang" wrote:
> > You cannot AddHeader with \r\n
>
> ah... thanks, terrible copy/paste mistake...
>
> > Also, not all responses generate SF_NOTIFY_SEND_RESPONSE. Since IIS
> > does not parse output data, only structured responses generate that
> > event. i.e. if you have an ISAPI which only used WriteClient() to
> > generate the response, there will be no SF_NOTIFY_SEND_RESPONSE for
> > that request/response pair.
>
> SF_NOTIFY_SEND_RESPONSE seems to works for  all of my applications, but I
> keep that in mind.
>
> One general question: Is there a good documentation for ISAPI development? I
> know there are descriptions for methods and notifications and of course I use
> them, but is there a more detailed guide to learn ISAPI development? I don't
> want to have to ask you each question that occours - and there are a lot > Thanks very much for answering my questions.
> Heinz
>
>
>
>
>
> > //David
> >http://w3-4u.blogspot.com
> >http://blogs.msdn.com/David.Wang
> > //
>
> > On Jul 18, 5:54 am, Heinz  wrote:
> > > Thanks for your advise. I'm required to get the timestamps for each request.
> > > I'm using SF_NOTIFY_PREPROC_HEADERS instead of SF_NOTIFY_READ_RAW_DATA now.
>
> > > I've just tested my ISAPI filter on IIS 6. SF_NOTIFY_PREPROC_HEADERS works
> > > fine. But I'm a little bit confused now because it seems that
> > > SF_NOTIFY_SEND_RESPONSE does not work on IIS 6. The only line of code I have
> > > in that notification is:
> > >         psr->AddHeader(pfc->m_pFC, "TestHeader:", "TestValue\r\n");
> > > Either the notification or this line does not work.
>
> > > Do you have any suggestions?
>
> > > Thanks,
> > > Heinz
>
> > > "David Wang" wrote:
> > > > Are you required to get timestamps on the actual test request, or are
> > > > you required to know how long the test request took.
>
> > > > Because IIS6 has ETW Tracing, which can be processed to give perfect
> > > > request processing time for any request, not just test requests.
>
> > > > Or you can add the header in SF_NOTIFY_PREPROC_HEADERS (instead of
> > > > SF_NOTIFY_READ_RAW_DATA), which is guaranteed to be only called once
> > > > per request and happens right after IIS reads in all the raw data but
> > > > before IIS starts parsing and processing the request. This code would
> > > > work on IIS5 and IIS6 in all modes.
>
> > > > //David
> > > >http://w3-4u.blogspot.com
> > > >http://blogs.msdn.com/David.Wang
> > > > //
>
> > > > On Jul 4, 5:34 am, Heinz  wrote:
> > > > > Okay let me try it again. Maybe my Enlish is too bad...
>
> > > > > When there comes a request for a site that runs on the IIS I'm working on,
> > > > > the request has to go through a lot of servers (firewall, load balancer,
> > > > > single sign on server, ... , and a load balancer again) until it reaches my
> > > > > maschine. My department is responsible for the performance of all that and
> > > > > thus we do some statistics on that topic. My job is to get the timestamps
> > > > > when the request reaches the IIS and when the response leaves. These two
> > > > > timestamps have to be added to the response as one header.
>
> > > > > That's what I did to do this: I wrote an ISAPI Filter that listens on
> > > > > SF_NOTIFY_READ_RAW_DATA to get the incoming timestamp. I add the timestamp to
> > > > > the Headers using AddResponseHeader(). The Filter also listens on
> > > > > SF_NOTIFY_SEND_RESPONSE to get the outgoing timestamp. I use GetHeader() to
> > > > > get the first timestamp and then I add both timestamp as one header to the
> > > > > request using SetHeader().
>
> > > > > My problems are now:
> > > > > 1. When SF_NOTIFY_READ_RAW_DATA occours more than once, the incoming
> > > > > timestamp will be overwritten - which is not what I want.
> > > > > 2. I read that SF_NOTIFY_READ_RAW_DATA will not work on IIS 6 (I've tested
> > > > > it on IIS 5 only so far).
>
> > > > > So my question is now: How do I get the first timestamp when I don't use
> > > > > SF_NOTIFY_READ_RAW_DATA? How can I make sure to get it only once? And how can
> > > > > I make the first timespamp available in SF_NOTIFY_SEND_RESPONSE?
>
> > > > > I hope this is what you need :-)
>
> > > > > Thanks,
> > > > > Heinz
>
> > > > > "David Wang" wrote:
> > > > > > On Jul 3, 6:45 am, Heinz  wrote:
> > > > > > > Thanks for your answer David. So what would be your advice? I need the
> > > > > > > Information when request arrives at the server and when the response leaves
> > > > > > > and I have to add this informatin to the response as a header> > > > > > > What I'm currently doing is: I get the system time when
> > > > > > > SF_NOTIFY_READ_RAW_DATA occours and add it as a header. When the
> > > > > > > SF_NOTIFY_SEND_RESPONSE notification occours I get the the system time again  
> > > > > > > and add it to the same header. It works for IIS 5 but it also has to work on
> > > > > > > IIS 6.
>
> > > > > > > This is what the response header looks linke:
> > > > > > >    IISTimestamps: 299410101710235842 299410101711172634
>
> > > > > > > So what should I do instead of using the SF_NOTIFY_READ_RAW_DATA
> > > > > > > notification? (I read there might be problems using this notification in IIS
> > > > > > > 6)
>
> > > > > > > Thanks,
> > > > > > > Heinz
>
> > > > > > You will need to describe why your filter is listening on
> > > > > > SF_NOTIFY_READ_RAW_DATA and trying to pass data to
> > > > > > SF_NOTIFY_SEND_RESPONSE in order for anyone to correctly assist you..
>
> > > > > > //David
> > > > > >http://w3-4u.blogspot.com
> > > > > >http://blogs.msdn.com/David.Wang
> > > > > > //- Hide quoted text -
>
> > > > > - Show quoted text -- Hide quoted text -
>
> > > - Show quoted text -- Hide quoted text -
>
> - Show quoted text -
date: Tue, 22 Jul 2008 19:47:50 -0700 (PDT)   author:   David Wang

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us