Annotation of libwww/Library/src/HTFilter.html, revision 2.1

2.1     ! frystyk     1: <HTML>
        !             2: <HEAD>
        !             3:   <!-- Changed by: Henrik Frystyk Nielsen,  5-Jul-1996 -->
        !             4:   <TITLE>W3C Reference Library libwww BEFORE and AFTER Filters</TITLE>
        !             5: </HEAD>
        !             6: <BODY>
        !             7: <H1>
        !             8:   Standard BEFORE and AFTER Filters
        !             9: </H1>
        !            10: <PRE>
        !            11: /*
        !            12: **     (c) COPYRIGHT MIT 1995.
        !            13: **     Please first read the full copyright statement in the file COPYRIGH.
        !            14: */
        !            15: </PRE>
        !            16: <P>
        !            17: This module provides a set of default <B>BEFORE</B> and <B>AFTER</B> filters
        !            18: that can be registered by the <A HREF="HTNet.html">Net manager</A> to be
        !            19: called before and after a request. All filters can be registered either to
        !            20: be called <I>globally</I> (all requests) or <I>locally</I> (pr request basis).
        !            21: <P>
        !            22: This module is implemented by <A HREF="HTFilter.c">HTFilter.c</A>, and it
        !            23: is a part of the <A HREF="http://www.w3.org/pub/WWW/Library/"> W3C Reference
        !            24: Library</A>.
        !            25: <PRE>
        !            26: #ifndef HTFILTER_H
        !            27: #define HTFILTER_H
        !            28: #include "WWWLib.h"
        !            29: </PRE>
        !            30: <H2>
        !            31:   BEFORE Filters
        !            32: </H2>
        !            33: <P>
        !            34: This is a standard set of <B>BEFORE</B> filters which the application may
        !            35: initialize. This can be done in an easy way using the function
        !            36: <CODE>HTBeforeInit()</CODE> in the <A HREF="WWWInit.html">Initialization
        !            37: interface</A>.
        !            38: <H3>
        !            39:   Proxy and Gateway BEFORE filter
        !            40: </H3>
        !            41: <P>
        !            42: Checks for registerd proxy servers or gateways and sees whether this request
        !            43: should be redirected to a proxy or a gateway. Proxies have higher priority
        !            44: than gateways so we look for them first! For HTTP/1.0 and HTTP/1.1 we may
        !            45: only send a full URL (including the host portion) to proxy servers. Therefore,
        !            46: we tell the Library whether to use the full URL or the traditional HTTP one
        !            47: without the host part.
        !            48: <PRE>
        !            49: extern int HTProxyFilter (HTRequest * request, void * param, int status);
        !            50: </PRE>
        !            51: <H3>
        !            52:   Rule Translation BEFORE Filter
        !            53: </H3>
        !            54: <P>
        !            55: If we have a set of rules loaded (see the Rule manager) then check before
        !            56: each request whether how that should be translated. The trick is that a parent
        !            57: anchor has a "address" which is the part from the URL we used when we created
        !            58: the anchor. However, it also have a "physical address" which is the place
        !            59: we are actually going to look for the resource. Hence this filter translates
        !            60: from the address to the physical address (if any translations are found)
        !            61: <PRE>
        !            62: extern int HTRuleFilter (HTRequest * request, void * param, int status);
        !            63: </PRE>
        !            64: <H3>
        !            65:   Cache Validation BEFORE Filter
        !            66: </H3>
        !            67: <P>
        !            68: Check the cache mode to see if we can use an already loaded version of this
        !            69: document. If so and our copy is valid then we don't have to go out and get
        !            70: it unless we are forced to
        !            71: <PRE>
        !            72: extern int HTCacheFilter (HTRequest * request, void * param, int status);
        !            73: </PRE>
        !            74: <H3>
        !            75:   Client side authentication BEFORE filter
        !            76: </H3>
        !            77: <P>
        !            78: The filter generates the credentials required to access a document Getting
        !            79: the credentials may involve asking the user in which case we use the methods
        !            80: registered by the <A HREF="HTAlert.html">HTAlert module</A>
        !            81: <PRE>    
        !            82: extern int HTCredentialsFilter (HTRequest * request, void * param, int status);
        !            83: </PRE>
        !            84: <H2>
        !            85:   AFTER Filters
        !            86: </H2>
        !            87: <P>
        !            88: Like <B>BEFORE</B> filters we provide a default set of typical <B>AFTER</B>
        !            89: filters that may be initialized by the application. Again, an easy way of
        !            90: doing this is to call the <CODE>HTAfterInit()</CODE> function in the
        !            91: <A HREF="WWWInit.html">Initialization interface</A>.
        !            92: <H3>
        !            93:   Error and Information filter
        !            94: </H3>
        !            95: <P>
        !            96: It checks the status code from a request and generates an error/information
        !            97: message if required.
        !            98: <PRE>
        !            99: extern int HTInfoFilter (HTRequest * request, void * param, int status);
        !           100: </PRE>
        !           101: <H3>
        !           102:   Redirection filter
        !           103: </H3>
        !           104: <P>
        !           105: The redirection handler only handles redirections on the <CODE>GET</CODE>
        !           106: or <CODE>HEAD</CODE> method (or any other safe method)
        !           107: <PRE>
        !           108: extern int HTRedirectFilter (HTRequest * request, void * param, int status);
        !           109: </PRE>
        !           110: <H3>
        !           111:   Client side authentication filter
        !           112: </H3>
        !           113: <P>
        !           114: The client side authentication filter uses the user dialog messages registered
        !           115: in the <A HREF="HTAlert.html">HTAlert module</A>. By default these are the
        !           116: ones used by the line mode browser but you can just register something else.
        !           117: <PRE>
        !           118: extern int HTAuthFilter (HTRequest * request, void * param, int status);
        !           119: </PRE>
        !           120: <H3>
        !           121:   Request Logging filter
        !           122: </H3>
        !           123: <P>
        !           124: Default Logging filter using the log manager provided by the
        !           125: <A HREF="HTLog.html">Log Manager</A>.
        !           126: <PRE>
        !           127: extern int HTLogFilter (HTRequest * request, void * param, int stutus);
        !           128: </PRE>
        !           129: <PRE>
        !           130: #endif /* HTFILTER_H */
        !           131: </PRE>
        !           132: <P>
        !           133:   <HR>
        !           134: <ADDRESS>
        !           135:   @(#) $Id: HTHome.html,v 2.9 1996/07/04 18:40:18 frystyk Exp $
        !           136: </ADDRESS>
        !           137: </BODY></HTML>

Webmaster