Definition:
typedef struct request_rec request_rec;
struct request_rec {
pool *pool;
conn_rec *connection;
server_rec *server;
request_rec *next;
request_rec *prev;
request_rec *main;
char *the_request;
int assbackwards;
enum proxyreqtype proxyreq;
int header_only;
char *protocol;
int proto_num;
char *hostname;
time_t request_time;
const char *status_line;
int status;
const char *method;
int method_number;
int allowed;
int sent_bodyct;
long bytes_sent;
time_t mtime;
int chunked;
int byterange;
char *boundary;
const char *range;
long clength;
long remaining;
long read_length;
int read_body;
int read_chunked;
unsigned expecting_100;
table *headers_in;
table *headers_out;
table *err_headers_out;
table *subprocess_env;
table *notes;
const char *content_type;
const char *handler;
const char *content_encoding;
const char *content_language;
array_header *content_languages;
char *vlist_validator;
int no_cache;
int no_local_copy;
char *unparsed_uri;
char *uri;
char *filename;
char *path_info;
char *args;
struct stat finfo;
uri_components parsed_uri;
void *per_dir_config;
void *request_config;
const struct htaccess_result *htaccess;
char *case_preserved_filename;
};
Usage example:
No examples available.
The request_rec structure is key to Apache's
processing of client requests. A pointer to a
request_req structure is passed to all
phase handlers and many API routines, and it is usually
given the argument name 'r' (e.g.,
ap_add_common_vars(r)).
pool *poolrequest_rec structure,
the pool pointer in the structure is available for
memory allocation. (See the description of ap_palloc()
and related routines.) When the request is completed, the
memory pool will be released.conn_rec *connectionconn_rec structure
describing the TCP/IP connexion over which the request was received.server_rec *serverserver_rec
structure for the virtual host which was assigned to handle the
request.request_rec *nextrequest_rec *prevrequest_rec *mainrequest_rec
structures in the case of a complex opertion involving
subrequests. The main pointer refers to the
request actually received from the client, as opposed to any
internal ones created by Apache during its request resolution.char *the_requestGET /index.html HTTP/1.1").int assbackwardsenum proxyreqtype proxyreqproxyreqtype enumeration for more information.int header_onlyHEAD method. The response headers will be returned,
but modules shouldn't bother to generate any content for the response.char *protocolHTTP/0.9" or "HTTP/1.1".int proto_numHTTP_VERSION_MAJOR() and
HTTP_VERSION_MINOR() macros (q.q.v.).char *hostnamer->the_request
string or the Host request header field). Note that
this value may be different from the name of the host actually
processing the request; that is, it may differ from any value in the
r->server->names array.time_t request_timeconst char *status_lineint statusHTTP_NOT_MODIFIED. It is typically
not used by modules because the protocol module derives the
correct value from module responses and the HTTP specification
defining the interaction of header fields.const char *methodGET", as extracted
from the r->the_request string. Modules may
want to reference this field if they handle extension methods not
directly known to the core server and therefore not represented by
a numeric value. (See th enext field, method_number.)int method_numberM_", such as "M_GET" and "M_DELETE"
(q.q.v.; see the description of M_GET for additional
references and information.)
If the request was made using a method unknown to the core server,
the value in this field will be M_INVALID, even if the
server has been configured to recognise the method (such as with
the Script directive). In this case modules should
check the string value in the method field of the
request_rec structure, which immediately precedes this
one.int allowedAllowed response header field.
It's a good idea to set it in an earlier phase if possible, in case
the request method is OPTIONS and will be handled by the
default_handler. Due to the dependence on hard-coded
bitmask values, Apache 1.3 provides no support for listing
extension methods in this field.int sent_bodyctlong bytes_senttime_t mtimeap_update_mtime()
or ap_rationalize_mtime() routines.int chunkedint byterangeRange field.char *boundaryconst char *rangeRange header field. This
is stored here for convenience; it is also available in the
headers_in table described below.long clengthap_set_content_length() routine (q.v.).long remaininglong read_lengthremaining field described above, this
field contains the count of bytes already read from the request bosy.
Modules must regard this as a read-only field.int read_bodyint read_chunkedunsigned expecting_100table *headers_inRange field, but all of the
original request header fields are stored in this table in their
raw form. Modules must regard this table as read-only.table *headers_outr->err_headers_out
table to form the response header.table *err_headers_outheaders_out table described
previously, the contents of this table are used in the
formation of the response header. However, the values in
this table are always used, even under
error conditions. Under normal conditions, they are merged
with those in the r->header_out table and
the result is used.table *subprocess_envmod_include, even though no actual
subprocess creation is involved.table *notesmod_speling uses this
table to pass a list of possible document variants to
mod_negotiation.const char *content_typer->headers_out or
r->err_headers_out.const char *handlerconst char *content_encodingconst char *content_languagearray_header *content_languageschar *vlist_validatorint no_cacheint no_local_copychar *unparsed_urichar *urichar *filenamechar *path_infochar *argsstruct stat finfouri_components parsed_urivoid *per_dir_configvoid *request_configconst struct htaccess_result *htaccesschar *case_preserved_filename
Previous: regmatch_t
Next: scoreboard
Table of Contents
(Routines,
Structures,
Data Cells,
Constants)