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

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: <H3>
2.42      frystyk    68:   Net Object
2.35      frystyk    69: </H3>
2.42      frystyk    70: <P>
                     71: Each request is assigned a Net object which contains pointers to other objects
                     72: handling the request.
2.35      frystyk    73: <PRE>
                     74:     HTNet *            net;                /* Information about socket etc. */
                     75: </PRE>
                     76: <H3>
2.42      frystyk    77:   Response Object
2.35      frystyk    78: </H3>
2.42      frystyk    79: <P>
                     80: When we start getting MIME headers in as a response we keep it in this object
                     81: until we know what to do with it.
2.35      frystyk    82: <PRE>
                     83:     HTResponse *        response;
                     84: </PRE>
                     85: <H3>
                     86:   Error Manager
                     87: </H3>
                     88: <PRE>
                     89:     HTList *           error_stack;                       /* List of errors */
                     90: </PRE>
                     91: <H3>
2.42      frystyk    92:   Have many times do We Want to Try?
2.35      frystyk    93: </H3>
                     94: <PRE>
                     95:     int                        retrys;               /* Number of automatic reloads */
                     96:     int                 max_forwards;
2.41      kahan      97:     int                        AAretrys;             /* Number of authentication
                     98:                                                  retries */
2.35      frystyk    99: </PRE>
                    100: <H3>
2.41      kahan     101:   Preemptive or Non-Preemptive load?
2.35      frystyk   102: </H3>
2.42      frystyk   103: <P>
                    104: Each protocol module is registered with a default behavior but if you have
                    105: registered a protocol module for non-preemtive load you can override this
                    106: by using the following flag.
2.35      frystyk   107: <PRE>
                    108:     BOOL               preemptive;
                    109: </PRE>
                    110: <H3>
2.42      frystyk   111:   Content Negotiation
2.35      frystyk   112: </H3>
2.42      frystyk   113: <P>
                    114: Normally, when we access the local file system we do content negotiation
                    115: in order to find the most suited representation. However, you can turn this
                    116: off by using the following flag.
2.35      frystyk   117: <PRE>
                    118:     BOOL               ContentNegotiation;
                    119: </PRE>
                    120: <H3>
2.40      frystyk   121:   Should we use preconditions?
                    122: </H3>
                    123: <PRE>
2.42      frystyk   124:     HTPreconditions     preconditions;
2.40      frystyk   125: </PRE>
                    126: <H3>
2.35      frystyk   127:   Headers and header information
                    128: </H3>
2.42      frystyk   129: <P>
2.35      frystyk   130: These are the masks that decides what headers to send.
                    131: <PRE>
                    132:     HTGnHd             GenMask;
                    133:     HTRsHd             ResponseMask;
                    134:     HTRqHd             RequestMask;
                    135:     HTEnHd             EntityMask;
                    136: </PRE>
                    137: <H3>
2.42      frystyk   138:   Local MIME Header Parsers
2.35      frystyk   139: </H3>
2.42      frystyk   140: <P>
2.35      frystyk   141: Each request can be assigned its own MIME header parsers.
                    142: <PRE>
                    143:     HTMIMEParseSet *   parseSet;
                    144:     BOOL               pars_local;
                    145: </PRE>
2.23      frystyk   146: <H3>
                    147:   Accept headers
                    148: </H3>
2.42      frystyk   149: <P>
2.35      frystyk   150: These are the accept headers that we want to send out.
2.1       frystyk   151: <PRE>
                    152:     HTList *           conversions;
                    153:     BOOL               conv_local;
                    154: 
                    155:     HTList *           encodings;
                    156:     BOOL               enc_local;
                    157: 
2.38      frystyk   158:     HTList *           tes;
                    159:     BOOL               te_local;
2.21      frystyk   160: 
2.1       frystyk   161:     HTList *           languages;
                    162:     BOOL               lang_local;
                    163: 
                    164:     HTList *           charsets;
                    165:     BOOL               char_local;
2.20      hallam    166: 
                    167:     HTList *           befores;
                    168:     BOOL               befores_local;
                    169: 
                    170:     HTList *           afters;
                    171:     BOOL               afters_local;
2.1       frystyk   172: </PRE>
2.35      frystyk   173: <H3>
2.42      frystyk   174:   Are we using a Proxy?
2.35      frystyk   175: </H3>
2.42      frystyk   176: <P>
2.35      frystyk   177: If so then we keep the name in this variable
                    178: <PRE>
                    179:     char *             proxy;
                    180:     BOOL                full_uri;
                    181: </PRE>
                    182: <H3>
                    183:   Cache Control Directives
                    184: </H3>
                    185: <P>
                    186: This association list is a list of the cache control directives that are
                    187: to be sent as part of the <CODE>Cache-Control</CODE> header.
                    188: <PRE>
                    189:     HTReload           reload;
                    190:     HTAssocList *       cache_control;
                    191: </PRE>
2.23      frystyk   192: <H3>
2.44.2.1! kahan     193:   Default PUT name
        !           194: </H3>
        !           195: <P>
        !           196: Stores the default name when publishing to a "/" URL.
        !           197: <PRE>
        !           198:    char *               default_put_name;
        !           199: </PRE>
        !           200: <H3>
2.42      frystyk   201:   Byte Ranges
2.35      frystyk   202: </H3>
2.42      frystyk   203: <P>
2.35      frystyk   204: This association list is a list of the cache control directives that are
                    205: to be sent as part of the <CODE>Range</CODE> header.
                    206: <PRE>
                    207:     HTAssocList *       byte_ranges;
                    208: </PRE>
                    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: <PRE>
                    216:     HTAssocList *       connection;
                    217: </PRE>
                    218: <H3>
2.38      frystyk   219:   Expect Directives
                    220: </H3>
                    221: <P>
2.42      frystyk   222: The Expect request-header field is used to indicate that particular server
                    223: behaviors are required by the client. A server that does not understand or
                    224: is unable to comply with any of the expectation values in the Expect field
                    225: of a request MUST respond with appropriate error status.
2.38      frystyk   226: <PRE>
                    227:     HTAssocList *       expect;
                    228: </PRE>
                    229: <H3>
2.35      frystyk   230:   Access Authentication Information
2.23      frystyk   231: </H3>
2.35      frystyk   232: <P>
2.42      frystyk   233: The <CODE>credentials</CODE> list contains the information that we are to
                    234: send as part of the <CODE>Authorization</CODE> header. The realm is if we
                    235: already know that we need to generate credentials for a specific realm.
2.1       frystyk   236: <PRE>
2.35      frystyk   237:     char *             realm;                              /* Current realm */
                    238:     HTAssocList *      credentials;       /* Credentials received by server */
                    239: </PRE>
                    240: <H3>
2.44      frystyk   241:   Request Header Extensibility
2.35      frystyk   242: </H3>
2.42      frystyk   243: <P>
2.44      frystyk   244:   <HR>
                    245: <H4>
                    246:   1) Simple Association List
                    247: </H4>
                    248: <P>
                    249: Add the (name, value) and it will be converted into MIME header format as
                    250: <CODE>name: value</CODE>. DO NOT ADD CRLF line termination - this is done
                    251: by the <A HREF="HTTPReq.html">HTTP header generator stream</A>
                    252: <PRE>
                    253:     HTAssocList        *       extra_headers;
                    254: </PRE>
                    255: <H4>
                    256:   2) Stream Oriented Header Generators
                    257: </H4>
                    258: <P>
                    259: A generator is a stream with direct access to the output stream
                    260: <PRE>
                    261:     HTList *           generators;
                    262:     BOOL               gens_local;
                    263: </PRE>
                    264: <H4>
                    265:   4) HTTP Extension Framework
                    266: </H4>
                    267: <P>
                    268: These association lists contain the information that we are to send as
                    269: <A HREF="/Protocols/HTTP/ietf-http-ext/">HTTP Extension Framework</A>.
2.35      frystyk   270: <PRE>
2.44      frystyk   271:     HTAssocList *      mandatory;
                    272:     HTAssocList *      optional;
2.1       frystyk   273: </PRE>
2.23      frystyk   274: <H3>
                    275:   Anchors
                    276: </H3>
2.1       frystyk   277: <PRE>
2.10      frystyk   278:     HTParentAnchor *   anchor;        /* The Client anchor for this request */
                    279: 
2.1       frystyk   280:     HTChildAnchor *    childAnchor;        /* For element within the object */
                    281:     HTParentAnchor *   parentAnchor;                   /* For referer field */
                    282: </PRE>
2.23      frystyk   283: <H3>
                    284:   Streams From Network to Application
                    285: </H3>
2.1       frystyk   286: <PRE>
                    287:     HTStream *         output_stream; 
2.43      frystyk   288:     HTStream *         orig_output_stream; 
2.1       frystyk   289:     HTFormat           output_format;
2.26      frystyk   290:     BOOL               connected;
2.1       frystyk   291: 
2.43      frystyk   292:     HTStream *         debug_stream;
                    293:     HTStream *         orig_debug_stream;
2.1       frystyk   294:     HTFormat           debug_format;
                    295: </PRE>
2.23      frystyk   296: <H3>
                    297:   Streams From Application to Network
                    298: </H3>
2.1       frystyk   299: <PRE>
                    300:     HTStream *         input_stream; 
                    301:     HTFormat           input_format;
                    302: </PRE>
2.23      frystyk   303: <H3>
                    304:   Callback Function for getting data down the Input Stream
                    305: </H3>
2.1       frystyk   306: <PRE>
2.5       frystyk   307:     HTPostCallback *   PostCallback;
2.1       frystyk   308: </PRE>
2.23      frystyk   309: <H3>
                    310:   Context Swapping
                    311: </H3>
2.1       frystyk   312: <PRE>
                    313:     HTRequestCallback *        callback;
                    314:     void *             context;
                    315: </PRE>
2.23      frystyk   316: <H3>
2.44      frystyk   317:   PostWeb Information (Not used anymore - don't use!)
2.23      frystyk   318: </H3>
2.1       frystyk   319: <PRE>
                    320:     HTRequest *                source;              /* Source for request or itself */
2.16      frystyk   321:     HTParentAnchor *   source_anchor;            /* Source anchor or itself */
                    322: 
2.1       frystyk   323:     HTRequest *                mainDestination;             /* For the typical case */
                    324:     HTList *           destinations;            /* List of related requests */
                    325:     int                        destRequests;      /* Number of destination requests */
                    326:     int                        destStreams;        /* Number of destination streams */
                    327: </PRE>
                    328: <PRE>
                    329: };
                    330: </PRE>
2.23      frystyk   331: <H2>
                    332:   Post Web Management
                    333: </H2>
                    334: <P>
                    335: These functions are mainly used internally in the Library but there is no
                    336: reason for them not to be public.
2.1       frystyk   337: <PRE>
                    338: extern BOOL HTRequest_addDestination (HTRequest * src, HTRequest * dest);
                    339: extern BOOL HTRequest_removeDestination        (HTRequest * dest);
2.14      frystyk   340: extern BOOL HTRequest_destinationsReady (HTRequest * me);
2.1       frystyk   341: 
                    342: extern BOOL HTRequest_linkDestination (HTRequest * dest);
                    343: extern BOOL HTRequest_unlinkDestination (HTRequest * dest);
                    344: 
                    345: extern BOOL HTRequest_removePostWeb (HTRequest * me);
                    346: extern BOOL HTRequest_killPostWeb (HTRequest * me);
                    347: 
                    348: #define        HTRequest_mainDestination(me) \
2.23      frystyk   349:        ((me) &amp;&amp; (me)-&gt;source ? (me)-&gt;source-&gt;mainDestination : NULL)
2.1       frystyk   350: #define HTRequest_isDestination(me) \
2.23      frystyk   351:        ((me) &amp;&amp; (me)-&gt;source &amp;&amp; (me) != (me)-&gt;source)
2.1       frystyk   352: #define HTRequest_isMainDestination(me) \
2.23      frystyk   353:        ((me) &amp;&amp; (me)-&gt;source &amp;&amp; \
                    354:        (me) == (me)-&gt;source-&gt;mainDestination)
2.1       frystyk   355: #define HTRequest_isSource(me) \
2.23      frystyk   356:        ((me) &amp;&amp; (me)-&gt;source &amp;&amp; (me) == (me)-&gt;source)
2.1       frystyk   357: </PRE>
2.23      frystyk   358: <P>
2.1       frystyk   359: End of Declaration
                    360: <PRE>
                    361: #endif /* HTREQMAN_H */
                    362: </PRE>
2.23      frystyk   363: <P>
                    364:   <HR>
2.21      frystyk   365: <ADDRESS>
2.44.2.1! kahan     366:   @(#) $Id: HTReqMan.html,v 2.44 1999/03/19 14:24:37 frystyk Exp $
2.21      frystyk   367: </ADDRESS>
2.23      frystyk   368: </BODY></HTML>

Webmaster