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

2.1       frystyk     1: <HTML>
                      2: <HEAD>
2.32      frystyk     3:   <!-- Changed by: Henrik Frystyk Nielsen, 15-Jul-1996 -->
2.37      frystyk     4:   <TITLE>W3C Sample Code 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
2.39      frystyk    24: is a part of the <A HREF="http://www.w3.org/Library/"> W3C Sample Code
2.23      frystyk    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.36      frystyk    54:     BOOL                flush;                /* Should we flush immediately */
                     55: 
2.5       frystyk    56:     HTPriority         priority;               /* Priority for this request */
2.1       frystyk    57: </PRE>
2.23      frystyk    58: <H3>
                     59:   User Profile
                     60: </H3>
                     61: <P>
                     62: Each request can be assigned a <A HREF="HTUser.html">user profile</A> containing
                     63: information about this host and the user issuing the request.
                     64: <PRE>
                     65:     HTUserProfile *    userprofile;
                     66: </PRE>
2.35      frystyk    67: 
                     68: <H3>
                     69: Net Object
                     70: </H3>
                     71: Each request is assigned a Net object which contains pointers to other objects handling the request.
                     72: <PRE>
                     73:     HTNet *            net;                /* Information about socket etc. */
                     74: </PRE>
                     75: 
                     76: <H3>
                     77: Response Object
                     78: </H3>
                     79: 
                     80: When we start getting MIME headers in as a response we keep it in this object until we know what to do with it.
                     81: 
                     82: <PRE>
                     83:     HTResponse *        response;
                     84: </PRE>
                     85: 
                     86: <H3>
                     87:   Error Manager
                     88: </H3>
                     89: <PRE>
                     90:     HTList *           error_stack;                       /* List of errors */
                     91: </PRE>
                     92: 
                     93: <H3>
                     94: Have many times do We Want to Try?
                     95: </H3>
                     96: 
                     97: <PRE>
                     98:     int                        retrys;               /* Number of automatic reloads */
                     99:     int                 max_forwards;
                    100: </PRE>
                    101: 
                    102: <H3>
                    103:   Preemtive or Non-Preemptive load?
                    104: </H3>
                    105: 
                    106: 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.
                    107: 
                    108: <PRE>
                    109:     BOOL               preemptive;
                    110: </PRE>
                    111: 
                    112: <H3>
                    113: Content Negotiation
                    114: </H3>
                    115: 
                    116: 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.
                    117: 
                    118: <PRE>
                    119:     BOOL               ContentNegotiation;
                    120: </PRE>
                    121: 
                    122: <H3>
2.40    ! frystyk   123:   Should we use preconditions?
        !           124: </H3>
        !           125: <PRE>
        !           126:     BOOL                preconditions;
        !           127: </PRE>
        !           128: 
        !           129: <H3>
2.35      frystyk   130:   Headers and header information
                    131: </H3>
                    132: 
                    133: These are the masks that decides what headers to send.
                    134: 
                    135: <PRE>
                    136:     HTGnHd             GenMask;
                    137:     HTRsHd             ResponseMask;
                    138:     HTRqHd             RequestMask;
                    139:     HTEnHd             EntityMask;
                    140: 
                    141:     HTList *           generators;
                    142:     BOOL               gens_local;
                    143: </PRE>
                    144: 
                    145: <H3>
                    146: Local MIME Header Parsers 
                    147: </H3>
                    148: 
                    149: Each request can be assigned its own MIME header parsers.
                    150: 
                    151: <PRE>
                    152:     HTMIMEParseSet *   parseSet;
                    153:     BOOL               pars_local;
                    154: </PRE>
                    155: 
2.23      frystyk   156: <H3>
                    157:   Accept headers
                    158: </H3>
2.35      frystyk   159: 
                    160: These are the accept headers that we want to send out.
                    161: 
2.1       frystyk   162: <PRE>
                    163:     HTList *           conversions;
                    164:     BOOL               conv_local;
                    165: 
                    166:     HTList *           encodings;
                    167:     BOOL               enc_local;
                    168: 
2.38      frystyk   169:     HTList *           tes;
                    170:     BOOL               te_local;
2.21      frystyk   171: 
2.1       frystyk   172:     HTList *           languages;
                    173:     BOOL               lang_local;
                    174: 
                    175:     HTList *           charsets;
                    176:     BOOL               char_local;
2.20      hallam    177: 
                    178:     HTList *           befores;
                    179:     BOOL               befores_local;
                    180: 
                    181:     HTList *           afters;
                    182:     BOOL               afters_local;
2.1       frystyk   183: </PRE>
2.35      frystyk   184: 
                    185: <H3>
                    186: Are we using a Proxy?
                    187: </H3>
                    188: 
                    189: If so then we keep the name in this variable
                    190: 
                    191: <PRE>
                    192:     char *             proxy;
                    193:     BOOL                full_uri;
                    194: </PRE>
                    195: 
                    196: <H3>
                    197:   Cache Control Directives
                    198: </H3>
                    199: <P>
                    200: This association list is a list of the cache control directives that are
                    201: to be sent as part of the <CODE>Cache-Control</CODE> header.
                    202: <PRE>
                    203:     HTReload           reload;
                    204:     HTAssocList *       cache_control;
                    205: </PRE>
                    206: 
2.23      frystyk   207: <H3>
2.35      frystyk   208: Byte Ranges
                    209: </H3>
                    210: 
                    211: This association list is a list of the cache control directives that are
                    212: to be sent as part of the <CODE>Range</CODE> header.
                    213: 
                    214: <PRE>
                    215:     HTAssocList *       byte_ranges;
                    216: </PRE>
                    217: 
                    218: <H3>
                    219:   Connection Control Directives
                    220: </H3>
                    221: <P>
                    222: This association list is a list of the connection control directives that
                    223: are to be sent as part of the <CODE>Connection</CODE> header.
                    224: 
                    225: <PRE>
                    226:     HTAssocList *       connection;
                    227: </PRE>
                    228: <H3>
2.38      frystyk   229:   Expect Directives
                    230: </H3>
                    231: <P>
                    232: The Expect request-header field is used to indicate that particular
                    233: server behaviors are required by the client.  A server that does not
                    234: understand or is unable to comply with any of the expectation values in
                    235: the Expect field of a request MUST respond with appropriate error
                    236: status.
                    237: 
                    238: <PRE>
                    239:     HTAssocList *       expect;
                    240: </PRE>
                    241: <H3>
2.35      frystyk   242:   Access Authentication Information
2.23      frystyk   243: </H3>
2.35      frystyk   244: <P>
                    245: 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   246: <PRE>
2.35      frystyk   247:     char *             realm;                              /* Current realm */
                    248:     HTAssocList *      credentials;       /* Credentials received by server */
                    249: </PRE>
                    250: <H3>
                    251:   Protocol Extension Protocol (PEP) Information
                    252: </H3>
2.5       frystyk   253: 
2.35      frystyk   254: These association lists contain the information that we are to send as PEP headers in the request.
2.5       frystyk   255: 
2.35      frystyk   256: <PRE>
                    257:     HTAssocList *      protocol;
                    258:     HTAssocList *      protocol_info;
                    259:     HTAssocList *      protocol_request;
2.1       frystyk   260: </PRE>
2.35      frystyk   261: 
2.23      frystyk   262: <H3>
                    263:   Anchors
                    264: </H3>
2.1       frystyk   265: <PRE>
2.10      frystyk   266:     HTParentAnchor *   anchor;        /* The Client anchor for this request */
                    267: 
2.1       frystyk   268:     HTChildAnchor *    childAnchor;        /* For element within the object */
                    269:     HTParentAnchor *   parentAnchor;                   /* For referer field */
                    270: </PRE>
2.23      frystyk   271: <H3>
                    272:   Streams From Network to Application
                    273: </H3>
2.1       frystyk   274: <PRE>
                    275:     HTStream *         output_stream; 
                    276:     HTFormat           output_format;
2.26      frystyk   277:     BOOL               connected;
2.1       frystyk   278: 
                    279:     HTStream*          debug_stream;
                    280:     HTFormat           debug_format;
                    281: </PRE>
2.23      frystyk   282: <H3>
                    283:   Streams From Application to Network
                    284: </H3>
2.1       frystyk   285: <PRE>
                    286:     HTStream *         input_stream; 
                    287:     HTFormat           input_format;
                    288: </PRE>
2.23      frystyk   289: <H3>
                    290:   Callback Function for getting data down the Input Stream
                    291: </H3>
2.1       frystyk   292: <PRE>
2.5       frystyk   293:     HTPostCallback *   PostCallback;
2.1       frystyk   294: </PRE>
2.23      frystyk   295: <H3>
                    296:   Context Swapping
                    297: </H3>
2.1       frystyk   298: <PRE>
                    299:     HTRequestCallback *        callback;
                    300:     void *             context;
                    301: </PRE>
2.23      frystyk   302: <H3>
                    303:   PostWeb Information
                    304: </H3>
2.1       frystyk   305: <PRE>
                    306:     HTRequest *                source;              /* Source for request or itself */
2.16      frystyk   307:     HTParentAnchor *   source_anchor;            /* Source anchor or itself */
                    308: 
2.1       frystyk   309:     HTRequest *                mainDestination;             /* For the typical case */
                    310:     HTList *           destinations;            /* List of related requests */
                    311:     int                        destRequests;      /* Number of destination requests */
                    312:     int                        destStreams;        /* Number of destination streams */
                    313: </PRE>
                    314: <PRE>
                    315: };
                    316: </PRE>
2.23      frystyk   317: <H2>
                    318:   Post Web Management
                    319: </H2>
                    320: <P>
                    321: These functions are mainly used internally in the Library but there is no
                    322: reason for them not to be public.
2.1       frystyk   323: <PRE>
                    324: extern BOOL HTRequest_addDestination (HTRequest * src, HTRequest * dest);
                    325: extern BOOL HTRequest_removeDestination        (HTRequest * dest);
2.14      frystyk   326: extern BOOL HTRequest_destinationsReady (HTRequest * me);
2.1       frystyk   327: 
                    328: extern BOOL HTRequest_linkDestination (HTRequest * dest);
                    329: extern BOOL HTRequest_unlinkDestination (HTRequest * dest);
                    330: 
                    331: extern BOOL HTRequest_removePostWeb (HTRequest * me);
                    332: extern BOOL HTRequest_killPostWeb (HTRequest * me);
                    333: 
                    334: #define        HTRequest_mainDestination(me) \
2.23      frystyk   335:        ((me) &amp;&amp; (me)-&gt;source ? (me)-&gt;source-&gt;mainDestination : NULL)
2.1       frystyk   336: #define HTRequest_isDestination(me) \
2.23      frystyk   337:        ((me) &amp;&amp; (me)-&gt;source &amp;&amp; (me) != (me)-&gt;source)
2.1       frystyk   338: #define HTRequest_isMainDestination(me) \
2.23      frystyk   339:        ((me) &amp;&amp; (me)-&gt;source &amp;&amp; \
                    340:        (me) == (me)-&gt;source-&gt;mainDestination)
2.1       frystyk   341: #define HTRequest_isSource(me) \
2.23      frystyk   342:        ((me) &amp;&amp; (me)-&gt;source &amp;&amp; (me) == (me)-&gt;source)
2.1       frystyk   343: </PRE>
2.23      frystyk   344: <P>
2.1       frystyk   345: End of Declaration
                    346: <PRE>
                    347: #endif /* HTREQMAN_H */
                    348: </PRE>
2.23      frystyk   349: <P>
                    350:   <HR>
2.21      frystyk   351: <ADDRESS>
2.40    ! frystyk   352:   @(#) $Id: HTReqMan.html,v 2.39 1998/05/14 02:11:00 frystyk Exp $
2.21      frystyk   353: </ADDRESS>
2.23      frystyk   354: </BODY></HTML>

Webmaster