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

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

Webmaster