Annotation of libwww/Library/src/HTReqMan.html, revision 2.46
2.46 ! kirschpi 1: <html>
! 2: <head>
! 3: <meta http-equiv="Content-Type" content="text/html">
2.32 frystyk 4: <!-- Changed by: Henrik Frystyk Nielsen, 15-Jul-1996 -->
2.46 ! kirschpi 5: <title>W3C Sample Code Library libwww Private Request Definition</title>
! 6: </head>
! 7:
! 8: <body>
! 9: <h1>Private Request Definition</h1>
! 10: <pre>/*
2.1 frystyk 11: ** (c) COPYRIGHT MIT 1995.
12: ** Please first read the full copyright statement in the file COPYRIGH.
2.46 ! kirschpi 13: */</pre>
! 14:
! 15: <p>This module is the private part of the request object. It has the
! 16: functions declarations that are private to the Library and that shouldn't be
! 17: used by applications. The module has been separated from the old HTAccess
! 18: module. See also the public part of the declarition in the <a
! 19: href="HTReq.html">HTReq Module</a>.</p>
! 20:
! 21: <p>This module is implemented by <a href="HTReqMan.c">HTReqMan.c</a>, and it
! 22: is a part of the <a href="http://www.w3.org/Library/"> W3C Sample Code
! 23: Library</a>.</p>
! 24: <pre>#ifndef HTREQMAN_H
2.1 frystyk 25: #define HTREQMAN_H
26:
2.46 ! kirschpi 27: #include "<a href="HTReq.html">HTReq.h</a>"
! 28: #include "<a href="HTList.html">HTList.h</a>"
! 29: #include "<a href="HTFormat.html">HTFormat.h</a>"
! 30: #include "<a href="HTAnchor.html">HTAnchor.h</a>"
! 31: #include "<a href="HTMethod.html">HTMethod.h</a>"
! 32: #include "<a href="HTAABrow.html">HTAABrow.h</a>"
! 33: #include "<a href="HTStream.html">HTStream.h</a>"
! 34: #include "<a href="HTNet.html">HTNet.h</a>"
! 35: #include "<a href="HTMIMPrs.html">HTMIMPrs.h</a>"</pre>
! 36:
! 37: <p>When a request is handled, all kinds of things about it need to be passed
2.23 frystyk 38: along together with a request. It is intended to live as long as the request
39: is still active, but can be deleted as soon as it has terminated. Only the
2.46 ! kirschpi 40: anchor object stays around after the request itself is terminated.</p>
! 41: <pre>struct _HTRequest {
2.14 frystyk 42:
43: BOOL internal; /* Does the app knows about this one? */
44:
2.33 frystyk 45: time_t date; /* Time stamp when the request was issued */
46:
2.1 frystyk 47: HTMethod method;
48:
2.36 frystyk 49: BOOL flush; /* Should we flush immediately */
50:
2.46 ! kirschpi 51: HTPriority priority; /* Priority for this request */</pre>
! 52:
! 53: <h3>Message body</h3>
! 54:
! 55: <p>A request message body indicated for XML bodies. It is used for extension
! 56: methods. See <a href="HTReq.html">HTReq.html</a> for details. </p>
! 57: <pre>#ifdef HT_EXT
! 58: char * messageBody;
! 59: long int messageBodyLength;
! 60: HTFormat messageBodyFormat;
! 61: #endif</pre>
! 62:
! 63: <h3>User Profile</h3>
! 64:
! 65: <p>Each request can be assigned a <a href="HTUser.html">user profile</a>
! 66: containing information about this host and the user issuing the request.</p>
! 67: <pre> HTUserProfile * userprofile;</pre>
! 68:
! 69: <h3>Net Object</h3>
! 70:
! 71: <p>Each request is assigned a Net object which contains pointers to other
! 72: objects handling the request.</p>
! 73: <pre> HTNet * net; /* Information about socket etc. */</pre>
! 74:
! 75: <h3>Response Object</h3>
! 76:
! 77: <p>When we start getting MIME headers in as a response we keep it in this
! 78: object until we know what to do with it.</p>
! 79: <pre> HTResponse * response;</pre>
! 80:
! 81: <h3>Error Manager</h3>
! 82: <pre> HTList * error_stack; /* List of errors */</pre>
! 83:
! 84: <h3>Have many times do We Want to Try?</h3>
! 85: <pre> int retrys; /* Number of automatic reloads */
2.35 frystyk 86: int max_forwards;
2.41 kahan 87: int AAretrys; /* Number of authentication
2.46 ! kirschpi 88: retries */</pre>
! 89:
! 90: <h3>Preemptive or Non-Preemptive load?</h3>
! 91:
! 92: <p>Each protocol module is registered with a default behavior but if you have
! 93: registered a protocol module for non-preemtive load you can override this by
! 94: using the following flag.</p>
! 95: <pre> BOOL preemptive;</pre>
! 96:
! 97: <h3>Content Negotiation</h3>
! 98:
! 99: <p>Normally, when we access the local file system we do content negotiation
2.42 frystyk 100: in order to find the most suited representation. However, you can turn this
2.46 ! kirschpi 101: off by using the following flag.</p>
! 102: <pre> BOOL ContentNegotiation;</pre>
! 103:
! 104: <h3>Should we use preconditions?</h3>
! 105: <pre> HTPreconditions preconditions;</pre>
! 106:
! 107: <h3>Headers and header information</h3>
! 108:
! 109: <p>These are the masks that decides what headers to send.</p>
! 110: <pre> HTGnHd GenMask;
2.35 frystyk 111: HTRsHd ResponseMask;
112: HTRqHd RequestMask;
2.46 ! kirschpi 113: HTEnHd EntityMask;</pre>
! 114:
! 115: <h3>Local MIME Header Parsers</h3>
! 116:
! 117: <p>Each request can be assigned its own MIME header parsers.</p>
! 118: <pre> HTMIMEParseSet * parseSet;
! 119: BOOL pars_local;</pre>
! 120:
! 121: <h3>Accept headers</h3>
! 122:
! 123: <p>These are the accept headers that we want to send out.</p>
! 124: <pre> HTList * conversions;
2.1 frystyk 125: BOOL conv_local;
126:
127: HTList * encodings;
128: BOOL enc_local;
129:
2.38 frystyk 130: HTList * tes;
131: BOOL te_local;
2.21 frystyk 132:
2.1 frystyk 133: HTList * languages;
134: BOOL lang_local;
135:
136: HTList * charsets;
137: BOOL char_local;
2.20 hallam 138:
139: HTList * befores;
140: BOOL befores_local;
141:
142: HTList * afters;
2.46 ! kirschpi 143: BOOL afters_local;</pre>
! 144:
! 145: <h3>Are we using a Proxy?</h3>
! 146:
! 147: <p>If so then we keep the name in this variable</p>
! 148: <pre> char * proxy;
! 149: BOOL full_uri;</pre>
! 150:
! 151: <h3>Cache Control Directives</h3>
! 152:
! 153: <p>This association list is a list of the cache control directives that are
! 154: to be sent as part of the <code>Cache-Control</code> header.</p>
! 155: <pre> HTReload reload;
! 156: HTAssocList * cache_control;</pre>
! 157:
! 158: <h3>Default PUT name</h3>
! 159:
! 160: <p>Stores the default name when publishing to a "/" URL.</p>
! 161: <pre> char * default_put_name;</pre>
! 162:
! 163: <h3>Byte Ranges</h3>
! 164:
! 165: <p>This association list is a list of the cache control directives that are
! 166: to be sent as part of the <code>Range</code> header.</p>
! 167: <pre> HTAssocList * byte_ranges;</pre>
! 168:
! 169: <h3>Connection Control Directives</h3>
! 170:
! 171: <p>This association list is a list of the connection control directives that
! 172: are to be sent as part of the <code>Connection</code> header.</p>
! 173: <pre> HTAssocList * connection;</pre>
! 174:
! 175: <h3>Expect Directives</h3>
! 176:
! 177: <p>The Expect request-header field is used to indicate that particular server
! 178: behaviors are required by the client. A server that does not understand or is
! 179: unable to comply with any of the expectation values in the Expect field of a
! 180: request MUST respond with appropriate error status.</p>
! 181: <pre> HTAssocList * expect;</pre>
! 182:
! 183: <h3>Access Authentication Information</h3>
! 184:
! 185: <p>The <code>credentials</code> list contains the information that we are to
! 186: send as part of the <code>Authorization</code> header. The realm is if we
! 187: already know that we need to generate credentials for a specific realm.</p>
! 188: <pre> char * realm; /* Current realm */
! 189: HTAssocList * credentials; /* Credentials received by server */</pre>
! 190:
! 191: <h3>Request Header Extensibility</h3>
! 192:
! 193: <p></p>
! 194: <hr>
! 195:
! 196: <h4>1) Simple Association List</h4>
! 197:
! 198: <p>Add the (name, value) and it will be converted into MIME header format as
! 199: <code>name: value</code>. DO NOT ADD CRLF line termination - this is done by
! 200: the <a href="HTTPReq.html">HTTP header generator stream</a></p>
! 201: <pre> HTAssocList * extra_headers;</pre>
! 202:
! 203: <h4>2) Stream Oriented Header Generators</h4>
! 204:
! 205: <p>A generator is a stream with direct access to the output stream</p>
! 206: <pre> HTList * generators;
! 207: BOOL gens_local;</pre>
! 208:
! 209: <h4>4) HTTP Extension Framework</h4>
! 210:
! 211: <p>These association lists contain the information that we are to send as <a
! 212: href="/Protocols/HTTP/ietf-http-ext/">HTTP Extension Framework</a>.</p>
! 213: <pre> HTAssocList * mandatory;
! 214: HTAssocList * optional;</pre>
! 215:
! 216: <h3>Anchors</h3>
! 217: <pre> HTParentAnchor * anchor; /* The Client anchor for this request */
2.10 frystyk 218:
2.1 frystyk 219: HTChildAnchor * childAnchor; /* For element within the object */
2.46 ! kirschpi 220: HTParentAnchor * parentAnchor; /* For referer field */</pre>
! 221:
! 222: <h3>Streams From Network to Application</h3>
! 223: <pre> HTStream * output_stream;
2.43 frystyk 224: HTStream * orig_output_stream;
2.1 frystyk 225: HTFormat output_format;
2.26 frystyk 226: BOOL connected;
2.1 frystyk 227:
2.43 frystyk 228: HTStream * debug_stream;
229: HTStream * orig_debug_stream;
2.46 ! kirschpi 230: HTFormat debug_format;</pre>
! 231:
! 232: <h3>Streams From Application to Network</h3>
! 233: <pre> HTStream * input_stream;
! 234: HTFormat input_format;</pre>
! 235:
! 236: <h3>Callback Function for getting data down the Input Stream</h3>
! 237: <pre> HTPostCallback * PostCallback;</pre>
! 238:
! 239: <h3>Context Swapping</h3>
! 240: <pre> HTRequestCallback * callback;
! 241: void * context;</pre>
! 242:
! 243: <h3>PostWeb Information (Not used anymore - don't use!)</h3>
! 244: <pre> HTRequest * source; /* Source for request or itself */
2.16 frystyk 245: HTParentAnchor * source_anchor; /* Source anchor or itself */
246:
2.1 frystyk 247: HTRequest * mainDestination; /* For the typical case */
248: HTList * destinations; /* List of related requests */
249: int destRequests; /* Number of destination requests */
2.46 ! kirschpi 250: int destStreams; /* Number of destination streams */</pre>
! 251: <pre>};</pre>
! 252:
! 253: <h2>Post Web Management</h2>
! 254:
! 255: <p>These functions are mainly used internally in the Library but there is no
! 256: reason for them not to be public.</p>
! 257: <pre>extern BOOL HTRequest_addDestination (HTRequest * src, HTRequest * dest);
2.1 frystyk 258: extern BOOL HTRequest_removeDestination (HTRequest * dest);
2.14 frystyk 259: extern BOOL HTRequest_destinationsReady (HTRequest * me);
2.1 frystyk 260:
261: extern BOOL HTRequest_linkDestination (HTRequest * dest);
262: extern BOOL HTRequest_unlinkDestination (HTRequest * dest);
263:
264: extern BOOL HTRequest_removePostWeb (HTRequest * me);
265: extern BOOL HTRequest_killPostWeb (HTRequest * me);
266:
267: #define HTRequest_mainDestination(me) \
2.23 frystyk 268: ((me) && (me)->source ? (me)->source->mainDestination : NULL)
2.1 frystyk 269: #define HTRequest_isDestination(me) \
2.23 frystyk 270: ((me) && (me)->source && (me) != (me)->source)
2.1 frystyk 271: #define HTRequest_isMainDestination(me) \
2.23 frystyk 272: ((me) && (me)->source && \
273: (me) == (me)->source->mainDestination)
2.1 frystyk 274: #define HTRequest_isSource(me) \
2.46 ! kirschpi 275: ((me) && (me)->source && (me) == (me)->source)</pre>
! 276:
! 277: <p>End of Declaration</p>
! 278: <pre>#endif /* HTREQMAN_H */</pre>
! 279:
! 280: <p></p>
! 281: <hr>
! 282: <address>
! 283: @(#) $Id: HTReqMan.html,v 2.45 2000/02/29 14:23:17 kahan Exp $
! 284: </address>
! 285: </body>
! 286: </html>
Webmaster