request_rec Struct Reference
[HTTP Daemon Routine]

A structure that represents the current request. More...

#include <httpd.h>

Collaboration diagram for request_rec:
Collaboration graph

Data Fields

char * the_request
int assbackwards
int proxyreq
int header_only
int proto_num
char * protocol
const char * hostname
apr_time_t request_time
const char * status_line
int status
int method_number
const char * method
apr_int64_t allowed
apr_off_t sent_bodyct
apr_off_t bytes_sent
apr_time_t mtime
const char * range
apr_off_t clength
int chunked
int read_body
int read_chunked
unsigned expecting_100
apr_off_t remaining
apr_off_t read_length
const char * content_type
const char * handler
const char * content_encoding
char * vlist_validator
char * user
char * ap_auth_type
char * unparsed_uri
char * uri
char * filename
char * canonical_filename
char * path_info
char * args
int used_path_info
int eos_sent
struct ap_conf_vector_tper_dir_config
struct ap_conf_vector_trequest_config
struct ap_logconflog
const char * log_id
struct htaccess_resulthtaccess
struct ap_filter_toutput_filters
struct ap_filter_tinput_filters
struct ap_filter_tproto_output_filters
struct ap_filter_tproto_input_filters
int no_cache
int no_local_copy
apr_uri_t parsed_uri
apr_finfo_t finfo
char * useragent_ip

Detailed Description

A structure that represents the current request.

Field Documentation

'allowed' is a bitvector of the allowed methods.

A handler must ensure that the request method is one that it is capable of handling. Generally modules should DECLINE any request methods they do not handle. Prior to aborting the handler like this the handler should set r->allowed to the list of methods that it is willing to handle. This bitvector is used to construct the "Allow:" header required for OPTIONS requests, and HTTP_METHOD_NOT_ALLOWED and HTTP_NOT_IMPLEMENTED status codes.

Since the default_handler deals with OPTIONS, all modules can usually decline to deal with OPTIONS. TRACE is always allowed, modules don't need to set it explicitly.

Since the default_handler will always handle a GET, a module which does *not* implement GET should probably return HTTP_METHOD_NOT_ALLOWED. Unfortunately this means that a Script GET handler can't be installed by mod_actions.

List of allowed methods

Array of extension methods

If an authentication check was made, this gets set to the auth type.

The QUERY_ARGS extracted from this request

HTTP/0.9, "simple" request (e.g. GET /foo
w/no headers)

For ap_body_to_table(): parsed body

body byte count, for easy access

The true filename, we canonicalize r->filename if these don't match

sending chunked transfer-coding

The "real" content length

The connection to the client

How to encode the data

Array of strings representing the content languages

The content-type for the current request

A flag to determine if the eos bucket has been sent yet

MIME header environment for the response, printed even on errors and persist across internal redirects

is client waiting for a 100 response?

The filename on disk corresponding to this response (st_mode) set to zero if no such file

const char* request_rec::handler

The handler string that we use to call a handler function

HEAD request, as opposed to GET

MIME header environment from the request

MIME header environment for the response

const char* request_rec::hostname

Host, as set by full URI or Host: header. For literal IPv6 addresses, this does NOT include the surrounding [ ]

A linked list of the .htaccess configuration directives accessed by this request. N.B. always add to the head of the list, _never_ to the end. that way, a sub request's list can (temporarily) point to a parent's list

A list of input filters to be used for this request

Mutex protect callbacks registered with ap_mpm_register_timed_callback from being run before the original handler finishes running

The optional kept body of the request.

Optional request log level configuration. Will usually point to a server or per_dir config, i.e. must be copied before modifying

const char* request_rec::log_id

Id to identify request in access and error log. Set when the first error log entry for this request is generated.

Pointer to the main request if this is a sub-request (see http_request.h)

const char* request_rec::method

Request method (eg. GET, HEAD, POST, etc.)

M_GET, M_POST, etc.

Last modified time of the requested resource

Pointer to the redirected request if this is an external redirect

This response can not be cached

There is no local copy of this response

Notes from one module to another

A list of output filters to be used for this request

A struct containing the components of URI

The PATH_INFO extracted from this request

Options set in config files, etc.

The pool associated with the request

Pointer to the previous request if this is an internal redirect

A list of protocol level input filters to be used for this request

Protocol version number of protocol; 1.1 = 1001

A list of protocol level output filters to be used for this request

Protocol string, as given to us, or HTTP/0.9

A proxy request (calculated during post_read_request/translate_name) possible values PROXYREQ_NONE, PROXYREQ_PROXY, PROXYREQ_REVERSE, PROXYREQ_RESPONSE

const char* request_rec::range

The Range: header

Method for reading the request body (eg. REQUEST_CHUNKED_ERROR, REQUEST_NO_BODY, REQUEST_CHUNKED_DECHUNK, etc...)

reading chunked transfer-coding

Number of bytes that have been read from the request body

Remaining bytes left to read from the request body

Notes on *this* request

Time when the request started

byte count in stream is for body

The virtual host for this request

Status line

Status line, if set by script

Array of environment variables to be used for sub processes

First line of request

MIME trailer environment from the request

MIME trailer environment from the response

The URI without any parsing performed

The path portion of the URI, or "/" if no path provided

Flag for the handler to accept or reject path_info on the current request. All modules should respect the AP_REQ_ACCEPT_PATH_INFO and AP_REQ_REJECT_PATH_INFO values, while AP_REQ_DEFAULT_PATH_INFO indicates they may follow existing conventions. This is set to the user's preference upon HOOK_VERY_FIRST of the fixups.

If an authentication check was made, this gets set to the user name.

remote address information from conn_rec, can be overridden if necessary by a module. This is the address that originated the request.

variant list validator (if negotiated)

The documentation for this struct was generated from the following file:
Generated on Sun Dec 21 12:10:14 2014 for Apache2 by  doxygen 1.6.3