Apache2
Collaboration diagram for Script Tools:

Macros

#define APACHE_ARG_MAX   512
 

Functions

char ** ap_create_environment (apr_pool_t *p, apr_table_t *t)
 
int ap_find_path_info (const char *uri, const char *path_info)
 
void ap_add_cgi_vars (request_rec *r)
 
void ap_add_common_vars (request_rec *r)
 
int ap_scan_script_header_err (request_rec *r, apr_file_t *f, char *buffer)
 
int ap_scan_script_header_err_ex (request_rec *r, apr_file_t *f, char *buffer, int module_index)
 
int ap_scan_script_header_err_brigade (request_rec *r, apr_bucket_brigade *bb, char *buffer)
 
int ap_scan_script_header_err_brigade_ex (request_rec *r, apr_bucket_brigade *bb, char *buffer, int module_index)
 
int ap_scan_script_header_err_strs (request_rec *r, char *buffer, const char **termch, int *termarg,...) AP_FN_ATTR_SENTINEL
 
int ap_scan_script_header_err_strs_ex (request_rec *r, char *buffer, int module_index, const char **termch, int *termarg,...) AP_FN_ATTR_SENTINEL
 
int ap_scan_script_header_err_core (request_rec *r, char *buffer, int(*getsfunc)(char *, int, void *), void *getsfunc_data)
 
int ap_scan_script_header_err_core_ex (request_rec *r, char *buffer, int(*getsfunc)(char *, int, void *), void *getsfunc_data, int module_index)
 
void ap_args_to_table (request_rec *r, apr_table_t **table)
 

Detailed Description

Macro Definition Documentation

◆ APACHE_ARG_MAX

#define APACHE_ARG_MAX   512

Function Documentation

◆ ap_add_cgi_vars()

void ap_add_cgi_vars ( request_rec r)

Add CGI environment variables required by HTTP/1.1 to the request's environment table

Parameters
rthe current request

◆ ap_add_common_vars()

void ap_add_common_vars ( request_rec r)

Add common CGI environment variables to the requests environment table

Parameters
rThe current request

◆ ap_args_to_table()

void ap_args_to_table ( request_rec r,
apr_table_t **  table 
)

Parse query args for the request and store in a new table allocated from the request pool. For args with no value, "1" will be used instead. If no query args were specified, the table will be empty.

Parameters
rThe current request
tableA new table on output.

◆ ap_create_environment()

char ** ap_create_environment ( apr_pool_t p,
apr_table_t t 
)

Create an environment variable out of an Apache table of key-value pairs

Parameters
ppool to allocate out of
tApache table of key-value pairs
Returns
An array containing the same key-value pairs suitable for use with an exec call.

◆ ap_find_path_info()

int ap_find_path_info ( const char *  uri,
const char *  path_info 
)

This "cute" little function comes about because the path info on filenames and URLs aren't always the same. So we take the two, and find as much of the two that match as possible.

Parameters
uriThe uri we are currently parsing
path_infoThe current path info
Returns
The length of the path info

◆ ap_scan_script_header_err()

int ap_scan_script_header_err ( request_rec r,
apr_file_t f,
char *  buffer 
)

Read headers output from a script, ensuring that the output is valid. If the output is valid, then the headers are added to the headers out of the current request. If the request method is GET or HEAD and the script's response will not meet the request's HTTP conditions, a conditional status code is returned.

Parameters
rThe current request
fThe file to read from
bufferEmpty when calling the function. On output, if there was an error, the string that cause the error is stored here.
Returns
HTTP_OK on success, HTTP_INTERNAL_SERVER_ERROR or other 5xx status code on failure, or a conditional status code (HTTP_NOT_MODIFIED or HTTP_PRECONDITION_FAILED) to indicate that the script's response does not meet the request's conditions

◆ ap_scan_script_header_err_brigade()

int ap_scan_script_header_err_brigade ( request_rec r,
apr_bucket_brigade bb,
char *  buffer 
)

Read headers output from a script, ensuring that the output is valid. If the output is valid, then the headers are added to the headers out of the current request. If the request method is GET or HEAD and the script's response will not meet the request's HTTP conditions, a conditional status code is returned.

Parameters
rThe current request
bbThe brigade from which to read
bufferEmpty when calling the function. On output, if there was an error, the string that cause the error is stored here.
Returns
HTTP_OK on success, HTTP_INTERNAL_SERVER_ERROR or other 5xx status code on failure, or a conditional status code (HTTP_NOT_MODIFIED or HTTP_PRECONDITION_FAILED) to indicate that the script's response does not meet the request's conditions

◆ ap_scan_script_header_err_brigade_ex()

int ap_scan_script_header_err_brigade_ex ( request_rec r,
apr_bucket_brigade bb,
char *  buffer,
int  module_index 
)

Read headers output from a script, ensuring that the output is valid. If the output is valid, then the headers are added to the headers out of the current request. If the request method is GET or HEAD and the script's response will not meet the request's HTTP conditions, a conditional status code is returned.

Parameters
rThe current request
bbThe brigade from which to read
bufferEmpty when calling the function. On output, if there was an error, the string that cause the error is stored here.
module_indexThe module index to be used for logging
Returns
HTTP_OK on success, HTTP_INTERNAL_SERVER_ERROR or other 5xx status code on failure, or a conditional status code (HTTP_NOT_MODIFIED or HTTP_PRECONDITION_FAILED) to indicate that the script's response does not meet the request's conditions

◆ ap_scan_script_header_err_core()

int ap_scan_script_header_err_core ( request_rec r,
char *  buffer,
int(*)(char *, int, void *)  getsfunc,
void *  getsfunc_data 
)

Read headers output from a script, ensuring that the output is valid. If the output is valid, then the headers are added to the headers out of the current request. If the request method is GET or HEAD and the script's response will not meet the request's HTTP conditions, a conditional status code is returned.

Parameters
rThe current request
bufferEmpty when calling the function. On output, if there was an error, the string that cause the error is stored here.
getsfuncFunction to read the headers from. This function should act like gets()
getsfunc_dataThe place to read from
Returns
HTTP_OK on success, HTTP_INTERNAL_SERVER_ERROR or other 5xx status code on failure, or a conditional status code (HTTP_NOT_MODIFIED or HTTP_PRECONDITION_FAILED) to indicate that the script's response does not meet the request's conditions

◆ ap_scan_script_header_err_core_ex()

int ap_scan_script_header_err_core_ex ( request_rec r,
char *  buffer,
int(*)(char *, int, void *)  getsfunc,
void *  getsfunc_data,
int  module_index 
)

Read headers output from a script, ensuring that the output is valid. If the output is valid, then the headers are added to the headers out of the current request. If the request method is GET or HEAD and the script's response will not meet the request's HTTP conditions, a conditional status code is returned.

Parameters
rThe current request
bufferEmpty when calling the function. On output, if there was an error, the string that cause the error is stored here.
getsfuncFunction to read the headers from. This function should act like gets()
getsfunc_dataThe place to read from
module_indexThe module index to be used for logging
Returns
HTTP_OK on success, HTTP_INTERNAL_SERVER_ERROR or other 5xx status code on failure, or a conditional status code (HTTP_NOT_MODIFIED or HTTP_PRECONDITION_FAILED) to indicate that the script's response does not meet the request's conditions

◆ ap_scan_script_header_err_ex()

int ap_scan_script_header_err_ex ( request_rec r,
apr_file_t f,
char *  buffer,
int  module_index 
)

Read headers output from a script, ensuring that the output is valid. If the output is valid, then the headers are added to the headers out of the current request. If the request method is GET or HEAD and the script's response will not meet the request's HTTP conditions, a conditional status code is returned.

Parameters
rThe current request
fThe file to read from
bufferEmpty when calling the function. On output, if there was an error, the string that cause the error is stored here.
module_indexThe module index to be used for logging
Returns
HTTP_OK on success, HTTP_INTERNAL_SERVER_ERROR or other 5xx status code on failure, or a conditional status code (HTTP_NOT_MODIFIED or HTTP_PRECONDITION_FAILED) to indicate that the script's response does not meet the request's conditions

◆ ap_scan_script_header_err_strs()

int ap_scan_script_header_err_strs ( request_rec r,
char *  buffer,
const char **  termch,
int termarg,
  ... 
)

Read headers strings from a script, ensuring that the output is valid. If the output is valid, then the headers are added to the headers out of the current request. If the request method is GET or HEAD and the script's response will not meet the request's HTTP conditions, a conditional status code is returned.

Parameters
rThe current request
bufferEmpty when calling the function. On output, if there was an error, the string that cause the error is stored here.
termchPointer to the last character parsed.
termargPointer to an int to capture the last argument parsed.

The varargs are string arguments to parse consecutively for headers, with a NULL argument to terminate the list.

Returns
HTTP_OK on success, HTTP_INTERNAL_SERVER_ERROR or other 5xx status code on failure, or a conditional status code (HTTP_NOT_MODIFIED or HTTP_PRECONDITION_FAILED) to indicate that the script's response does not meet the request's conditions

◆ ap_scan_script_header_err_strs_ex()

int ap_scan_script_header_err_strs_ex ( request_rec r,
char *  buffer,
int  module_index,
const char **  termch,
int termarg,
  ... 
)

Read headers strings from a script, ensuring that the output is valid. If the output is valid, then the headers are added to the headers out of the current request. If the request method is GET or HEAD and the script's response will not meet the request's HTTP conditions, a conditional status code is returned.

Parameters
rThe current request
bufferEmpty when calling the function. On output, if there was an error, the string that cause the error is stored here.
module_indexThe module index to be used for logging
termchPointer to the last character parsed.
termargPointer to an int to capture the last argument parsed.

The varargs are string arguments to parse consecutively for headers, with a NULL argument to terminate the list.

Returns
HTTP_OK on success, HTTP_INTERNAL_SERVER_ERROR or other 5xx status code on failure, or a conditional status code (HTTP_NOT_MODIFIED or HTTP_PRECONDITION_FAILED) to indicate that the script's response does not meet the request's conditions