Annotation of libwww/Library/src/HTReqMan.html, revision 2.35

2.1       frystyk     1: <HTML>
                      2: <HEAD>
2.32      frystyk     3:   <!-- Changed by: Henrik Frystyk Nielsen, 15-Jul-1996 -->
2.23      frystyk     4:   <TITLE>W3C Reference Library libwww Private Request Definition</TITLE>
2.1       frystyk     5: </HEAD>
                      6: <BODY>
2.23      frystyk     7: <H1>
                      8:   Private Request Definition
                      9: </H1>
2.1       frystyk    10: <PRE>
                     11: /*
                     12: **     (c) COPYRIGHT MIT 1995.
                     13: **     Please first read the full copyright statement in the file COPYRIGH.
                     14: */
                     15: </PRE>
2.23      frystyk    16: <P>
                     17: This module is the private part of the request object. It has the functions
                     18: declarations that are private to the Library and that shouldn't be used by
                     19: applications. The module has been separated from the old HTAccess module.
                     20: See also the public part of the declarition in the <A HREF="HTReq.html">HTReq
                     21: Module</A>.
                     22: <P>
                     23: This module is implemented by <A HREF="HTReqMan.c">HTReqMan.c</A>, and it
                     24: is a part of the <A HREF="http://www.w3.org/pub/WWW/Library/"> W3C Reference
                     25: Library</A>.
2.1       frystyk    26: <PRE>
                     27: #ifndef HTREQMAN_H
                     28: #define HTREQMAN_H
                     29: 
                     30: #include "<A HREF="HTReq.html">HTReq.h</A>"
                     31: #include "<A HREF="HTList.html">HTList.h</A>"
                     32: #include "<A HREF="HTFormat.html">HTFormat.h</A>"
                     33: #include "<A HREF="HTAnchor.html">HTAnchor.h</A>"
                     34: #include "<A HREF="HTMethod.html">HTMethod.h</A>"
                     35: #include "<A HREF="HTAABrow.html">HTAABrow.h</A>"
                     36: #include "<A HREF="HTStream.html">HTStream.h</A>"
                     37: #include "<A HREF="HTNet.html">HTNet.h</A>"
2.25      eric       38: #include "<A HREF="HTMIMPrs.html">HTMIMPrs.h</A>"
2.1       frystyk    39: </PRE>
2.23      frystyk    40: <P>
                     41: When a request is handled, all kinds of things about it need to be passed
                     42: along together with a request. It is intended to live as long as the request
                     43: is still active, but can be deleted as soon as it has terminated. Only the
                     44: anchor object stays around after the request itself is terminated.
2.1       frystyk    45: <PRE>
                     46: struct _HTRequest {
2.14      frystyk    47: 
                     48:     BOOL               internal;      /* Does the app knows about this one? */
                     49: 
2.33      frystyk    50:     time_t             date;      /* Time stamp when the request was issued */
                     51: 
2.1       frystyk    52:     HTMethod           method;
                     53: 
2.5       frystyk    54:     HTPriority         priority;               /* Priority for this request */
2.1       frystyk    55: </PRE>
2.23      frystyk    56: <H3>
                     57:   User Profile
                     58: </H3>
                     59: <P>
                     60: Each request can be assigned a <A HREF="HTUser.html">user profile</A> containing
                     61: information about this host and the user issuing the request.
                     62: <PRE>
                     63:     HTUserProfile *    userprofile;
                     64: </PRE>
2.35    ! frystyk    65: 
        !            66: <H3>
        !            67: Net Object
        !            68: </H3>
        !            69: Each request is assigned a Net object which contains pointers to other objects handling the request.
        !            70: <PRE>
        !            71:     HTNet *            net;                /* Information about socket etc. */
        !            72: </PRE>
        !            73: 
        !            74: <H3>
        !            75: Response Object
        !            76: </H3>
        !            77: 
        !            78: When we start getting MIME headers in as a response we keep it in this object until we know what to do with it.
        !            79: 
        !            80: <PRE>
        !            81:     HTResponse *        response;
        !            82: </PRE>
        !            83: 
        !            84: <H3>
        !            85:   Error Manager
        !            86: </H3>
        !            87: <PRE>
        !            88:     HTList *           error_stack;                       /* List of errors */
        !            89: </PRE>
        !            90: 
        !            91: <H3>
        !            92: Have many times do We Want to Try?
        !            93: </H3>
        !            94: 
        !            95: <PRE>
        !            96:     int                        retrys;               /* Number of automatic reloads */
        !            97:     int                 max_forwards;
        !            98: </PRE>
        !            99: 
        !           100: <H3>
        !           101:   Preemtive or Non-Preemptive load?
        !           102: </H3>
        !           103: 
        !           104: Each protocol module is registered with a default behavior but if you have registered a protocol module for non-preemtive load you can override this by using the following flag.
        !           105: 
        !           106: <PRE>
        !           107:     BOOL               preemptive;
        !           108: </PRE>
        !           109: 
        !           110: <H3>
        !           111: Content Negotiation
        !           112: </H3>
        !           113: 
        !           114: Normally, when we access the local file system we do content negotiation in order to find the most suited representation. However, you can turn this off by using the following flag.
        !           115: 
        !           116: <PRE>
        !           117:     BOOL               ContentNegotiation;
        !           118: </PRE>
        !           119: 
        !           120: <H3>
        !           121:   Headers and header information
        !           122: </H3>
        !           123: 
        !           124: These are the masks that decides what headers to send.
        !           125: 
        !           126: <PRE>
        !           127:     HTGnHd             GenMask;
        !           128:     HTRsHd             ResponseMask;
        !           129:     HTRqHd             RequestMask;
        !           130:     HTEnHd             EntityMask;
        !           131: 
        !           132:     HTList *           generators;
        !           133:     BOOL               gens_local;
        !           134: </PRE>
        !           135: 
        !           136: <H3>
        !           137: Local MIME Header Parsers 
        !           138: </H3>
        !           139: 
        !           140: Each request can be assigned its own MIME header parsers.
        !           141: 
        !           142: <PRE>
        !           143:     HTMIMEParseSet *   parseSet;
        !           144:     BOOL               pars_local;
        !           145: </PRE>
        !           146: 
2.23      frystyk   147: <H3>
                    148:   Accept headers
                    149: </H3>
2.35    ! frystyk   150: 
        !           151: These are the accept headers that we want to send out.
        !           152: 
2.1       frystyk   153: <PRE>
                    154:     HTList *           conversions;
                    155:     BOOL               conv_local;
                    156: 
                    157:     HTList *           encodings;
                    158:     BOOL               enc_local;
                    159: 
2.22      frystyk   160:     HTList *           ctes;
                    161:     BOOL               cte_local;
2.21      frystyk   162: 
2.1       frystyk   163:     HTList *           languages;
                    164:     BOOL               lang_local;
                    165: 
                    166:     HTList *           charsets;
                    167:     BOOL               char_local;
2.20      hallam    168: 
                    169:     HTList *           befores;
                    170:     BOOL               befores_local;
                    171: 
                    172:     HTList *           afters;
                    173:     BOOL               afters_local;
2.1       frystyk   174: </PRE>
2.35    ! frystyk   175: 
        !           176: <H3>
        !           177: Are we using a Proxy?
        !           178: </H3>
        !           179: 
        !           180: If so then we keep the name in this variable
        !           181: 
        !           182: <PRE>
        !           183:     char *             proxy;
        !           184:     BOOL                full_uri;
        !           185: </PRE>
        !           186: 
        !           187: <H3>
        !           188:   Cache Control Directives
        !           189: </H3>
        !           190: <P>
        !           191: This association list is a list of the cache control directives that are
        !           192: to be sent as part of the <CODE>Cache-Control</CODE> header.
        !           193: <PRE>
        !           194:     HTReload           reload;
        !           195:     HTAssocList *       cache_control;
        !           196: </PRE>
        !           197: 
2.23      frystyk   198: <H3>
2.35    ! frystyk   199: Byte Ranges
        !           200: </H3>
        !           201: 
        !           202: This association list is a list of the cache control directives that are
        !           203: to be sent as part of the <CODE>Range</CODE> header.
        !           204: 
        !           205: <PRE>
        !           206:     HTAssocList *       byte_ranges;
        !           207: </PRE>
        !           208: 
        !           209: <H3>
        !           210:   Connection Control Directives
        !           211: </H3>
        !           212: <P>
        !           213: This association list is a list of the connection control directives that
        !           214: are to be sent as part of the <CODE>Connection</CODE> header.
        !           215: 
        !           216: <PRE>
        !           217:     HTAssocList *       connection;
        !           218: </PRE>
        !           219: <H3>
        !           220:   Access Authentication Information
2.23      frystyk   221: </H3>
2.35    ! frystyk   222: <P>
        !           223: The <CODE>credentials</CODE> list contains the information that we are to send as part of the <CODE>Authorization</CODE> header. The realm is if we already know that we need to generate credentials for a specific realm.
2.1       frystyk   224: <PRE>
2.35    ! frystyk   225:     char *             realm;                              /* Current realm */
        !           226:     HTAssocList *      credentials;       /* Credentials received by server */
        !           227: </PRE>
        !           228: <H3>
        !           229:   Protocol Extension Protocol (PEP) Information
        !           230: </H3>
2.5       frystyk   231: 
2.35    ! frystyk   232: These association lists contain the information that we are to send as PEP headers in the request.
2.5       frystyk   233: 
2.35    ! frystyk   234: <PRE>
        !           235:     HTAssocList *      protocol;
        !           236:     HTAssocList *      protocol_info;
        !           237:     HTAssocList *      protocol_request;
2.1       frystyk   238: </PRE>
2.35    ! frystyk   239: 
2.23      frystyk   240: <H3>
                    241:   Anchors
                    242: </H3>
2.1       frystyk   243: <PRE>
2.10      frystyk   244:     HTParentAnchor *   anchor;        /* The Client anchor for this request */
                    245: 
2.1       frystyk   246:     HTChildAnchor *    childAnchor;        /* For element within the object */
                    247:     HTParentAnchor *   parentAnchor;                   /* For referer field */
                    248: </PRE>
2.23      frystyk   249: <H3>
                    250:   Streams From Network to Application
                    251: </H3>
2.1       frystyk   252: <PRE>
                    253:     HTStream *         output_stream; 
                    254:     HTFormat           output_format;
2.26      frystyk   255:     BOOL               connected;
2.1       frystyk   256: 
                    257:     HTStream*          debug_stream;
                    258:     HTFormat           debug_format;
                    259: </PRE>
2.23      frystyk   260: <H3>
                    261:   Streams From Application to Network
                    262: </H3>
2.1       frystyk   263: <PRE>
                    264:     HTStream *         input_stream; 
                    265:     HTFormat           input_format;
                    266: </PRE>
2.23      frystyk   267: <H3>
                    268:   Callback Function for getting data down the Input Stream
                    269: </H3>
2.1       frystyk   270: <PRE>
2.5       frystyk   271:     HTPostCallback *   PostCallback;
2.1       frystyk   272: </PRE>
2.23      frystyk   273: <H3>
                    274:   Context Swapping
                    275: </H3>
2.1       frystyk   276: <PRE>
                    277:     HTRequestCallback *        callback;
                    278:     void *             context;
                    279: </PRE>
2.23      frystyk   280: <H3>
                    281:   PostWeb Information
                    282: </H3>
2.1       frystyk   283: <PRE>
                    284:     HTRequest *                source;              /* Source for request or itself */
2.16      frystyk   285:     HTParentAnchor *   source_anchor;            /* Source anchor or itself */
                    286: 
2.1       frystyk   287:     HTRequest *                mainDestination;             /* For the typical case */
                    288:     HTList *           destinations;            /* List of related requests */
                    289:     int                        destRequests;      /* Number of destination requests */
                    290:     int                        destStreams;        /* Number of destination streams */
                    291: </PRE>
                    292: <PRE>
                    293: };
                    294: </PRE>
2.23      frystyk   295: <H2>
                    296:   Post Web Management
                    297: </H2>
                    298: <P>
                    299: These functions are mainly used internally in the Library but there is no
                    300: reason for them not to be public.
2.1       frystyk   301: <PRE>
                    302: extern BOOL HTRequest_addDestination (HTRequest * src, HTRequest * dest);
                    303: extern BOOL HTRequest_removeDestination        (HTRequest * dest);
2.14      frystyk   304: extern BOOL HTRequest_destinationsReady (HTRequest * me);
2.1       frystyk   305: 
                    306: extern BOOL HTRequest_linkDestination (HTRequest * dest);
                    307: extern BOOL HTRequest_unlinkDestination (HTRequest * dest);
                    308: 
                    309: extern BOOL HTRequest_removePostWeb (HTRequest * me);
                    310: extern BOOL HTRequest_killPostWeb (HTRequest * me);
                    311: 
                    312: #define        HTRequest_mainDestination(me) \
2.23      frystyk   313:        ((me) &amp;&amp; (me)-&gt;source ? (me)-&gt;source-&gt;mainDestination : NULL)
2.1       frystyk   314: #define HTRequest_isDestination(me) \
2.23      frystyk   315:        ((me) &amp;&amp; (me)-&gt;source &amp;&amp; (me) != (me)-&gt;source)
2.1       frystyk   316: #define HTRequest_isMainDestination(me) \
2.23      frystyk   317:        ((me) &amp;&amp; (me)-&gt;source &amp;&amp; \
                    318:        (me) == (me)-&gt;source-&gt;mainDestination)
2.1       frystyk   319: #define HTRequest_isSource(me) \
2.23      frystyk   320:        ((me) &amp;&amp; (me)-&gt;source &amp;&amp; (me) == (me)-&gt;source)
2.1       frystyk   321: </PRE>
2.23      frystyk   322: <P>
2.1       frystyk   323: End of Declaration
                    324: <PRE>
                    325: #endif /* HTREQMAN_H */
                    326: </PRE>
2.23      frystyk   327: <P>
                    328:   <HR>
2.21      frystyk   329: <ADDRESS>
2.35    ! frystyk   330:   @(#) $Id: HTReqMan.html,v 2.34 1996/09/16 21:33:48 eric Exp $
2.21      frystyk   331: </ADDRESS>
2.23      frystyk   332: </BODY></HTML>

Webmaster