NSAPI: AuthTrans SAF for 6.0: distinguish sub-requests (e.g. SSI)?
I've got an AuthTrans access control SAF that provides access based on the client's apparent IP address. This SAF keeps a running count of the requests recognized. I would like this running count to only count distinct HTTP requests from the client, but it is also counting SSI requests.
That is, if the HTML page includes one SSI include tag:
-the client only makes one HTTP request to us (for "/index.htm")
-my AuthTrans runs twice, for /index.htm and for /includes/banner.htm
I call the request for /includes/banner.htm a "sub-request" because while Web Server handles it as a separate request, it is not explicitly made by the client.
I would like to add some C code to my NSAPI library so that my SAF could distinguish the sub-requests (/includes/banner.htm) from the "natural" requests (/index.htm), so that it would only count the "natural" hits (while still protecting sub-request content). Is there a good, clean way of doing that?
I know that I could (in our case) do something like
thisUri = pblock_findval("uri",rq->reqpb);
if ( (thisUri != NULL) && (strstr(thisUri,"/includes/") == thisUri) ) {
/* treat it as a sub-request */
}
I would much rather use a good NSAPI hook that didn't rely on my updating strings & carefully deploying my include files.
Thanks,
Peter

