home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Spezial
/
SPEZIAL2_97.zip
/
SPEZIAL2_97.iso
/
ANWEND
/
ONLINE
/
SREFV12J
/
POSTFILT.80
< prev
next >
Wrap
Text File
|
1997-06-30
|
5KB
|
144 lines
/* a sample of a SRE-FILTER "post-filter" - */
/* A very simple transaction recorder (use PMPRINTF to record it)*/
postfilt:
parse arg amessage,source,request,sel,tempfile,servername,host_nickname,used_file,thereferer,tcache
parse var source serveraddr serverport transaction_number clientaddr clientport
sel=packur(sel)
request=packur(request)
CALL pmprintf_sref(" - - - - - ")
AT=time() ; AD=date()
CALL pmprintf_sref(AT ' ' AD)
CALL pmprintf_sref( " Status Message = " amessage)
CALL pmprintf_sref( " From Server = " servername)
CALL pmprintf_sref( " Client address = " clientaddr)
cALL pmprintf_sref( " Sel (requested URL) = " sel)
call pmprintf_sref( ' File sent (or used) = ' Used_file)
return ' '
/*******************************************************************
*******************************************************************
*******************************************************************/
/*
---------------- General notes ------------------------
SRE-FILTER call this procedure when the POST_FILTER variable is set to YES,
and POSTFILTER_NAME='POSTFILT.80'.
Reminder: You can "chain" post filters (see INITFILT.DOC for details)!
8 arguments are passed here:
amessage
source
request
sel0
tempfile
servername
host_nickname
used_file
Amessage
is generated by SRE-FILTER, and indicates what SRE-FILTER did with this request.
Source,request,and sel0 are generated by GoServe, and contain:
Source
serveraddr serverport transaction_number clientaddr clientport
Request
verb uri protocol
Sel0
action '?' awords (?awords may not be present). Note that to avoid
parsing problems, commas are converted to %2c -- you can convert them
back using the PACKUR function.
Tempfile is set in SRE-FILTER
Tempfile
A temporary file name. It may have been used to construct the response, so you probably should
delete it first (use SYSFILEDELETE(TEMPFILE) ).
Servername
The name of the server to whom this request was directed. This
may be an alias (if you have an appropriate HOSTS. entry).
Host_nickname
The "nickname" for this servername -- used by SRE-Filter when
looking up parameters, access control, etc.
USED_FILE
The file actually used by SRE-Filter. Examples include:
the document or .GIF file sent in response to the request.
the CGI script executed.
TheReferer
The value of the 'referer' request header -- if set, it contains
the absolute url which contained the link which invoked this request.
Example of arguments sent:
amessage HTML File sent:/INDEX.HTM
Source 151.121.65.143 80 3 219.134.78.12 1026
request GET /sampask2.htm HTTP/1.0
sel0 sampask2.htm
tempfile D:/GOHTTP/$10.80
servername www.oursite.net
host_nickname www1
params mail.myprovider.net
used_file D:\WWW\SAMPASK2.HTM
Note on Amessage:
The folllowing lists the "messages" that SRE-FILTER may send. Note that the ||varname
means the value of Varname is appended to the message. Also note that when varname=SEL,
the SEL may be different then SEL0 (say, if a ~ replacement occurred).
AWORDS is stuff following a ? in the SEL, ACTION is the stuff before a ?,
AFILE is a file name
Note on host_nickname:
On single host servers, where there are no HOSTS. entries, host_nickname
will be blank.
------------------------------------------------------------
The following contains an almost complete list of "amessages" .
Note that AN_ARG depends on the request.
Bad request for public file
Pre-filter used
Cached file sent: AN_ARG
Bad HTTP Protocol
Literal public file not found: AN_ARG
Literal public file returned: AN_ARG
Unauthorized access
No client name found, access denied
Logon denied to non-inhouse user
Pre-filter used
Alias invoked redirect
Transfered non-data directory file: AN_ARG
CGI-BIN call: AN_ARG
HEAD request: Document not found: AN_ARG
Head request
Head request with autoheader
Byte ranges in Non-HTML File sent: AN_ARG
Non-HTML File sent: AN_ARG
Remote Non-HTML File sent: AN_ARG
HTML File sent: AN_ARG
HTML File sent (with ssi): AN_ARG
Remote post_filter_message
Mappable image request, file missing: AN_ARG
Mappable image request: AN_ARG
Script processor: not allowed
POST error: too much data
POST error: could not read data = error_code
Script processor: not allowed
PUT request: AN_ARG
DELETE request: AN_ARG
**************************************************************************/