Apache2
|
Data Structures | |
struct | ap_fcgi_header |
A structure that represents the fixed header fields at the beginning of a "FastCGI record" (i.e., the data prior to content data and padding). More... | |
struct | ap_fcgi_begin_request_body |
This represents the content data of the FastCGI record when the type is AP_FCGI_BEGIN_REQUEST. More... | |
Functions | |
void | ap_fcgi_header_to_array (ap_fcgi_header *h, unsigned char a[]) |
void | ap_fcgi_header_from_array (ap_fcgi_header *h, unsigned char a[]) |
void | ap_fcgi_header_fields_from_array (unsigned char *version, unsigned char *type, apr_uint16_t *request_id, apr_uint16_t *content_len, unsigned char *padding_len, unsigned char a[]) |
void | ap_fcgi_begin_request_body_to_array (ap_fcgi_begin_request_body *h, unsigned char a[]) |
void | ap_fcgi_fill_in_header (ap_fcgi_header *header, unsigned char type, apr_uint16_t request_id, apr_uint16_t content_len, unsigned char padding_len) |
void | ap_fcgi_fill_in_request_body (ap_fcgi_begin_request_body *brb, int role, unsigned char flags) |
apr_size_t | ap_fcgi_encoded_env_len (apr_table_t *env, apr_size_t maxlen, int *starting_elem) |
apr_status_t | ap_fcgi_encode_env (request_rec *r, apr_table_t *env, void *buffer, apr_size_t buflen, int *starting_elem) |
#define AP_FCGI_ABORT_REQUEST 2 |
#define AP_FCGI_APACHE_ROLE_ACCESS_CHECKER_STR "ACCESS_CHECKER" |
#define AP_FCGI_APACHE_ROLE_AUTHENTICATOR_STR "AUTHENTICATOR" |
#define AP_FCGI_APACHE_ROLE_AUTHORIZER_STR "AUTHORIZER" |
#define AP_FCGI_AUTHORIZER 2 |
#define AP_FCGI_AUTHORIZER_STR "AUTHORIZER" |
#define AP_FCGI_BEGIN_REQUEST 1 |
Possible values for the type field of ap_fcgi_header
#define AP_FCGI_BRB_FLAGS_OFFSET 2 |
#define AP_FCGI_BRB_RESERVED0_OFFSET 3 |
#define AP_FCGI_BRB_RESERVED1_OFFSET 4 |
#define AP_FCGI_BRB_RESERVED2_OFFSET 5 |
#define AP_FCGI_BRB_RESERVED3_OFFSET 6 |
#define AP_FCGI_BRB_RESERVED4_OFFSET 7 |
#define AP_FCGI_BRB_ROLEB0_OFFSET 1 |
#define AP_FCGI_BRB_ROLEB1_OFFSET 0 |
Offsets of the various fields of ap_fcgi_begin_request_body
#define AP_FCGI_DATA 8 |
#define AP_FCGI_END_REQUEST 3 |
#define AP_FCGI_FILTER 3 |
#define AP_FCGI_FILTER_STR "FILTER" |
#define AP_FCGI_GET_VALUES 9 |
#define AP_FCGI_GET_VALUES_RESULT 10 |
#define AP_FCGI_HDR_CONTENT_LEN_B0_OFFSET 5 |
#define AP_FCGI_HDR_CONTENT_LEN_B1_OFFSET 4 |
#define AP_FCGI_HDR_PADDING_LEN_OFFSET 6 |
#define AP_FCGI_HDR_REQUEST_ID_B0_OFFSET 3 |
#define AP_FCGI_HDR_REQUEST_ID_B1_OFFSET 2 |
#define AP_FCGI_HDR_RESERVED_OFFSET 7 |
#define AP_FCGI_HDR_TYPE_OFFSET 1 |
#define AP_FCGI_HDR_VERSION_OFFSET 0 |
Offsets of the various fields of ap_fcgi_header
#define AP_FCGI_HEADER_LEN 8 |
#define AP_FCGI_KEEP_CONN 1 /* otherwise the application closes */ |
#define AP_FCGI_MAX_CONTENT_LEN 65535 |
#define AP_FCGI_MAXTYPE (AP_FCGI_UNKNOWN_TYPE) |
#define AP_FCGI_PARAMS 4 |
#define AP_FCGI_RESPONDER 1 |
#define AP_FCGI_RESPONDER_STR "RESPONDER" |
String forms for the value of the FCGI_ROLE envvar
#define AP_FCGI_STDERR 7 |
#define AP_FCGI_STDIN 5 |
#define AP_FCGI_STDOUT 6 |
#define AP_FCGI_UNKNOWN_TYPE 11 |
#define AP_FCGI_VERSION_1 1 |
Possible values for the version field of ap_fcgi_header
void ap_fcgi_begin_request_body_to_array | ( | ap_fcgi_begin_request_body * | h, |
unsigned char | a[] | ||
) |
Pack ap_fcgi_begin_request_body
h | The begin-request body to read from |
a | The array to write to, of size AP_FCGI_HEADER_LEN |
apr_status_t ap_fcgi_encode_env | ( | request_rec * | r, |
apr_table_t * | env, | ||
void * | buffer, | ||
apr_size_t | buflen, | ||
int * | starting_elem | ||
) |
Encode the next portion of the provided environment table using a buffer previously allocated.
r | The request, for logging |
env | The environment table |
buffer | A buffer to contain the encoded environment table |
buflen | The length of the buffer, previously computed by ap_fcgi_encoded_env_len(). |
starting_elem | On input, the next element of the table array to process in this FastCGI record. On output, the next element to process on the next FastCGI record. |
apr_size_t ap_fcgi_encoded_env_len | ( | apr_table_t * | env, |
apr_size_t | maxlen, | ||
int * | starting_elem | ||
) |
Compute the buffer size needed to encode the next portion of the provided environment table.
env | The environment table |
maxlen | The maximum buffer size allowable, capped at AP_FCGI_MAX_CONTENT_LEN. |
starting_elem | On input, the next element of the table array to process in this FastCGI record. On output, the next element to process on the next FastCGI record. |
void ap_fcgi_fill_in_header | ( | ap_fcgi_header * | header, |
unsigned char | type, | ||
apr_uint16_t | request_id, | ||
apr_uint16_t | content_len, | ||
unsigned char | padding_len | ||
) |
Fill in a FastCGI request header with the required field values.
header | The header to fill in |
type | The type of record |
request_id | The request id |
content_len | The amount of content which follows the header |
padding_len | The amount of padding which follows the content |
The header array must be at least AP_FCGI_HEADER_LEN bytes long.
void ap_fcgi_fill_in_request_body | ( | ap_fcgi_begin_request_body * | brb, |
int | role, | ||
unsigned char | flags | ||
) |
Fill in a FastCGI begin request body with the required field values.
brb | The begin-request-body to fill in |
role | AP_FCGI_RESPONDER or other roles |
flags | 0 or a combination of flags like AP_FCGI_KEEP_CONN |
void ap_fcgi_header_fields_from_array | ( | unsigned char * | version, |
unsigned char * | type, | ||
apr_uint16_t * | request_id, | ||
apr_uint16_t * | content_len, | ||
unsigned char * | padding_len, | ||
unsigned char | a[] | ||
) |
Unpack header of FastCGI record into individual fields
version | The version, on output |
type | The type, on output |
request_id | The request id, on output |
content_len | The content length, on output |
padding_len | The amount of padding following the content, on output |
a | The array to read from, of size AP_FCGI_HEADER_LEN |
void ap_fcgi_header_from_array | ( | ap_fcgi_header * | h, |
unsigned char | a[] | ||
) |
Unpack header of FastCGI record into ap_fcgi_header
h | The header to write to |
a | The array to read from, of size AP_FCGI_HEADER_LEN |
void ap_fcgi_header_to_array | ( | ap_fcgi_header * | h, |
unsigned char | a[] | ||
) |
Pack ap_fcgi_header
h | The header to read from |
a | The array to write to, of size AP_FCGI_HEADER_LEN |