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

2.1       frystyk     1: <HTML>
                      2: <HEAD>
2.19      frystyk     3: <TITLE>W3C Reference Library libwww REQUEST OBJECT</TITLE>
2.18      frystyk     4: <!-- Changed by: Henrik Frystyk Nielsen, 20-Feb-1996 -->
2.20    ! hallam      5: <!-- Changed by: Eric Prud'hommeaux, 21-Mar-1996 -->
2.1       frystyk     6: </HEAD>
                      7: <BODY>
                      8: 
2.11      frystyk     9: <H1>Request Object</H1>
2.1       frystyk    10: 
                     11: <PRE>
                     12: /*
                     13: **     (c) COPYRIGHT MIT 1995.
                     14: **     Please first read the full copyright statement in the file COPYRIGH.
                     15: */
                     16: </PRE>
                     17: 
2.11      frystyk    18: This module is the private part of the request object. It has the
2.1       frystyk    19: functions declarations that are private to the Library and that
                     20: shouldn't be used by applications. The module has been separated from
                     21: the old HTAccess module. See also the public part of the declarition
                     22: in the <A HREF="HTReq.html">HTReq Module</A>.<P>
                     23: 
                     24: This module is implemented by <A HREF="HTReqMan.c">HTReqMan.c</A>, and
2.3       frystyk    25: it is a part of the <A HREF="http://www.w3.org/pub/WWW/Library/"> W3C
                     26: Reference Library</A>. <P>
2.1       frystyk    27: 
                     28: <PRE>
                     29: #ifndef HTREQMAN_H
                     30: #define HTREQMAN_H
                     31: 
                     32: #include "<A HREF="HTReq.html">HTReq.h</A>"
                     33: #include "<A HREF="HTList.html">HTList.h</A>"
                     34: #include "<A HREF="HTFormat.html">HTFormat.h</A>"
                     35: #include "<A HREF="HTAnchor.html">HTAnchor.h</A>"
                     36: #include "<A HREF="HTMethod.html">HTMethod.h</A>"
                     37: #include "<A HREF="HTAABrow.html">HTAABrow.h</A>"
                     38: #include "<A HREF="HTStream.html">HTStream.h</A>"
2.8       frystyk    39: #include "<A HREF="HTSocket.html">HTSocket.h</A>"
2.1       frystyk    40: #include "<A HREF="HTNet.html">HTNet.h</A>"
                     41: </PRE>
                     42: 
                     43: <H2><A NAME="req">The Request structure</A></H2>
                     44: 
                     45: When a request is handled, all kinds of things about it need to be
                     46: passed along together with a request. It is intended to live as long
                     47: as the request is still active, but can be deleted as soon as it has
                     48: terminated. Only the anchor object stays around after the request
                     49: itself is terminated.
                     50: 
                     51: <PRE>
                     52: struct _HTRequest {
2.14      frystyk    53: 
                     54:     BOOL               internal;      /* Does the app knows about this one? */
                     55: 
2.1       frystyk    56:     HTMethod           method;
                     57:     HTReload           reload;
                     58: 
2.6       frystyk    59:     char *             boundary;                 /* MIME multipart boundary */
2.1       frystyk    60:     int                        retrys;               /* Number of automatic reloads */
                     61:     time_t             retry_after;             /* Absolut time for a retry */
                     62:     HTNet *            net;                /* Information about socket etc. */
2.5       frystyk    63:     HTPriority         priority;               /* Priority for this request */
2.1       frystyk    64: </PRE>
                     65: 
                     66: <H3>Accept headers</H3>
                     67: 
                     68: <PRE>
                     69:     HTList *           conversions;
                     70:     BOOL               conv_local;
                     71: 
                     72:     HTList *           encodings;
                     73:     BOOL               enc_local;
                     74: 
                     75:     HTList *           languages;
                     76:     BOOL               lang_local;
                     77: 
                     78:     HTList *           charsets;
                     79:     BOOL               char_local;
2.20    ! hallam     80: 
        !            81:     HTList *           befores;
        !            82:     BOOL               befores_local;
        !            83: 
        !            84:     HTList *           afters;
        !            85:     BOOL               afters_local;
2.1       frystyk    86: </PRE>
                     87: 
                     88: <H3>Headers and header information</H3>
                     89: 
                     90: <PRE>
                     91:     HTGnHd             GenMask;
2.12      frystyk    92:     HTRsHd             ResponseMask;
2.1       frystyk    93:     HTRqHd             RequestMask;
                     94:     HTEnHd             EntityMask;
2.5       frystyk    95: 
                     96:     HTList *           parsers;
                     97:     BOOL               pars_local;
                     98: 
                     99:     HTList *           generators;
                    100:     BOOL               gens_local;
2.1       frystyk   101: </PRE>
                    102: 
                    103: <H3>Anchors</H3>
                    104: 
                    105: <PRE>
2.10      frystyk   106:     HTParentAnchor *   anchor;        /* The Client anchor for this request */
                    107: 
2.1       frystyk   108:     HTChildAnchor *    childAnchor;        /* For element within the object */
                    109:     HTParentAnchor *   parentAnchor;                   /* For referer field */
                    110: </PRE>
                    111: 
2.14      frystyk   112: <H4>Redirection</H4>
                    113: 
                    114: If we get a redirection back then we return the new destination for
                    115: this request to the application using this anchor.
                    116: 
                    117: <PRE>
                    118:     HTAnchor *         redirectionAnchor;                /* Redirection URL */
                    119: </PRE>
                    120: 
2.1       frystyk   121: <H3>Streams From Network to Application</H3>
                    122: 
                    123: <PRE>
                    124:     HTStream *         output_stream; 
                    125:     HTFormat           output_format;
                    126: 
                    127:     HTStream*          debug_stream;
                    128:     HTFormat           debug_format;
                    129: </PRE>
                    130: 
                    131: <H3>Streams From Application to Network</H3>
                    132: 
                    133: <PRE>
                    134:     HTStream *         input_stream; 
                    135:     HTFormat           input_format;
                    136: </PRE>
                    137: 
                    138: <H3>Callback Function for getting data down the Input Stream</H3>
                    139: 
                    140: <PRE>
2.5       frystyk   141:     HTPostCallback *   PostCallback;
2.1       frystyk   142: </PRE>
                    143: 
                    144: <H3>Context Swapping</H3>
                    145: 
                    146: <PRE>
                    147:     HTRequestCallback *        callback;
                    148:     void *             context;
                    149: </PRE>
                    150: 
                    151: <H3>Other Flags</H3>
                    152: 
                    153: <PRE>
2.13      frystyk   154:     BOOL               preemptive;
2.1       frystyk   155:     BOOL               ContentNegotiation;
                    156:     BOOL               using_proxy;
                    157: </PRE>
                    158: 
                    159: <H3>Error Manager</H3>
                    160: 
                    161: <PRE>
                    162:     HTList *           error_stack;                       /* List of errors */
                    163: </PRE>
                    164: 
                    165: <H3>PostWeb Information</H3>
                    166: 
                    167: <PRE>
                    168:     HTRequest *                source;              /* Source for request or itself */
2.16      frystyk   169:     HTParentAnchor *   source_anchor;            /* Source anchor or itself */
                    170: 
2.1       frystyk   171:     HTRequest *                mainDestination;             /* For the typical case */
                    172:     HTList *           destinations;            /* List of related requests */
                    173:     int                        destRequests;      /* Number of destination requests */
                    174:     int                        destStreams;        /* Number of destination streams */
                    175: </PRE>
                    176: 
                    177: <H3>Access Authentication Information</H3>
                    178: 
2.18      frystyk   179: The <CODE>challenge</CODE> and the <CODE>credentials</CODE> entries
                    180: are use by the authentication parsers and generators respectively. It
                    181: is required to have a <CODE>scheme</CODE> in order to find a parser
                    182: for an authentication scheme.
2.1       frystyk   183: 
                    184: <PRE>
2.17      frystyk   185:     char *             scheme;             /* Current authentication scheme */
                    186:     char *             realm;                              /* Current realm */
2.18      frystyk   187: 
2.17      frystyk   188:     HTAssocList *      challenge;           /* Challenge received by client */
                    189:     HTAssocList *      credentials;       /* Credentials received by server */
2.1       frystyk   190: </PRE>
                    191: 
                    192: <H3>Windows Specific Information</H3>
                    193: 
                    194: <PRE>
2.7       frystyk   195: #ifdef WWW_WIN_ASYNC
                    196:     HWND               hwnd;           /* Windows handle for MSWindows   */
                    197:     unsigned long      winMsg;         /* msg number of Windows eloop    */
                    198: #endif /* WWW_WIN_ASYNC */
2.1       frystyk   199: </PRE>
                    200: 
                    201: <PRE>
                    202: };
                    203: </PRE>
                    204: 
                    205: <H2>Post Web Management</H2>
                    206: 
                    207: These functions are mainly used internally in the Library but there is
                    208: no reason for them not to be public.
                    209: 
                    210: <PRE>
                    211: extern BOOL HTRequest_addDestination (HTRequest * src, HTRequest * dest);
                    212: extern BOOL HTRequest_removeDestination        (HTRequest * dest);
2.14      frystyk   213: extern BOOL HTRequest_destinationsReady (HTRequest * me);
2.1       frystyk   214: 
                    215: extern BOOL HTRequest_linkDestination (HTRequest * dest);
                    216: extern BOOL HTRequest_unlinkDestination (HTRequest * dest);
                    217: 
                    218: extern BOOL HTRequest_removePostWeb (HTRequest * me);
                    219: extern BOOL HTRequest_killPostWeb (HTRequest * me);
                    220: 
                    221: #define        HTRequest_mainDestination(me) \
                    222:        ((me) &amp;&amp; (me)->source ? (me)->source->mainDestination : NULL)
                    223: #define HTRequest_isDestination(me) \
                    224:        ((me) &amp;&amp; (me)->source &amp;&amp; (me) != (me)->source)
                    225: #define HTRequest_isMainDestination(me) \
                    226:        ((me) &amp;&amp; (me)->source &amp;&amp; \
                    227:        (me) == (me)->source->mainDestination)
                    228: #define HTRequest_isSource(me) \
                    229:        ((me) &amp;&amp; (me)->source &amp;&amp; (me) == (me)->source)
2.3       frystyk   230: #define HTRequest_isPostWeb(me) ((me) &amp;&amp; (me)->source)
                    231: #define HTRequest_source(me) ((me) ? (me)->source : NULL)
2.1       frystyk   232: </PRE>
                    233: 
                    234: End of Declaration
                    235: 
                    236: <PRE>
                    237: #endif /* HTREQMAN_H */
                    238: </PRE>
                    239: end of HTAccess
                    240: </BODY>
                    241: </HTML>

Webmaster