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