diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/ap_mmn.h | 21 | ||||
-rw-r--r-- | include/ap_release.h | 18 | ||||
-rw-r--r-- | include/heartbeat.h | 5 | ||||
-rw-r--r-- | include/http_protocol.h | 66 | ||||
-rw-r--r-- | include/http_request.h | 19 | ||||
-rw-r--r-- | include/httpd.h | 50 | ||||
-rw-r--r-- | include/util_filter.h | 23 |
7 files changed, 180 insertions, 22 deletions
diff --git a/include/ap_mmn.h b/include/ap_mmn.h index 2efda87e..89c41409 100644 --- a/include/ap_mmn.h +++ b/include/ap_mmn.h @@ -400,7 +400,24 @@ * 20120211.8 (2.4.3-dev) Add sticky_separator to proxy_balancer_shared struct. * 20120211.9 (2.4.4-dev) Add fgrab() to ap_slotmem_provider_t. * 20120211.10 (2.4.4-dev) Add in bal_persist field to proxy_server_conf - * 20120211.11 (2.4.4-dev) Add ap_bin2hex() + * 20120211.11 (2.4.4-dev) Add ap_bin2hex() + * 20120211.12 (2.4.5-dev) Add ap_remove_input|output_filter_byhandle() + * 20120211.13 (2.4.5-dev) Add ap_get_exec_line + * 20120211.14 (2.4.5-dev) Add ppinherit and inherit to proxy_server_conf + * 20120211.15 (2.4.5-dev) Add dav_join_error() + * 20120211.16 (2.4.5-dev) Add cache_control_t.invalidated + * 20120211.17 (2.4.5-dev) Add ap_find_etag_weak(), ap_find_etag_strong() + * 20120211.18 (2.4.5-dev) Add ap_condition_e, ap_condition_if_match(), + * ap_condition_if_unmodified_since(), + * ap_condition_if_none_match(), + * ap_condition_if_modified_since(), + * ap_condition_if_range() + * 20120211.19 (2.4.5-dev) Add post_perdir_config hook. + * 20120211.20 (2.4.5-dev) Add dirwalk_stat hook. + * 20120211.21 (2.4.5-dev) Add in ap_proxy_create_hdrbrgd() and + * ap_proxy_pass_brigade() + * 20120211.22 (2.4.5-dev) No longer prevent usage of strtoul() + * 20120211.23 (2.4.5-dev) Add ap_proxy_clear_connection() */ #define MODULE_MAGIC_COOKIE 0x41503234UL /* "AP24" */ @@ -408,7 +425,7 @@ #ifndef MODULE_MAGIC_NUMBER_MAJOR #define MODULE_MAGIC_NUMBER_MAJOR 20120211 #endif -#define MODULE_MAGIC_NUMBER_MINOR 11 /* 0...n */ +#define MODULE_MAGIC_NUMBER_MINOR 23 /* 0...n */ /** * Determine if the server's current MODULE_MAGIC_NUMBER is at least a diff --git a/include/ap_release.h b/include/ap_release.h index f01d3a10..0d54fa6f 100644 --- a/include/ap_release.h +++ b/include/ap_release.h @@ -22,8 +22,6 @@ #ifndef AP_RELEASE_H #define AP_RELEASE_H -#include "apr_general.h" /* stringify */ - #define AP_SERVER_COPYRIGHT \ "Copyright 2013 The Apache Software Foundation." @@ -45,15 +43,25 @@ #define AP_SERVER_MAJORVERSION_NUMBER 2 #define AP_SERVER_MINORVERSION_NUMBER 4 -#define AP_SERVER_PATCHLEVEL_NUMBER 4 +#define AP_SERVER_PATCHLEVEL_NUMBER 6 #define AP_SERVER_DEVBUILD_BOOLEAN 0 -#define AP_SERVER_ADD_STRING "-dev" /* Synchronize the above with docs/manual/style/version.ent */ #if !AP_SERVER_DEVBUILD_BOOLEAN -#undef AP_SERVER_ADD_STRING #define AP_SERVER_ADD_STRING "" +#else +#ifndef AP_SERVER_ADD_STRING +#define AP_SERVER_ADD_STRING "-dev" +#endif +#endif + +/* APR_STRINGIFY is defined here, and also in apr_general.h, so wrap it */ +#ifndef APR_STRINGIFY +/** Properly quote a value as a string in the C preprocessor */ +#define APR_STRINGIFY(n) APR_STRINGIFY_HELPER(n) +/** Helper macro for APR_STRINGIFY */ +#define APR_STRINGIFY_HELPER(n) #n #endif /* keep old macros as well */ diff --git a/include/heartbeat.h b/include/heartbeat.h index 7f9ed385..394aed8c 100644 --- a/include/heartbeat.h +++ b/include/heartbeat.h @@ -47,6 +47,11 @@ typedef struct hm_slot_server_t int id; } hm_slot_server_t; +/* default name of heartbeat data file, created in the configured + * runtime directory when mod_slotmem_shm is not available + */ +#define DEFAULT_HEARTBEAT_STORAGE "hb.dat" + #ifdef __cplusplus } #endif diff --git a/include/http_protocol.h b/include/http_protocol.h index cd1942e5..415270b2 100644 --- a/include/http_protocol.h +++ b/include/http_protocol.h @@ -167,6 +167,72 @@ AP_DECLARE(void) ap_set_etag(request_rec *r); */ AP_DECLARE(void) ap_set_last_modified(request_rec *r); +typedef enum { + AP_CONDITION_NONE, + AP_CONDITION_NOMATCH, + AP_CONDITION_WEAK, + AP_CONDITION_STRONG +} ap_condition_e; + +/** + * Tests conditional request rules for the If-Match header. + * @param r The current request + * @param headers The response headers to check against + * @return AP_CONDITION_NONE if the header is missing, AP_CONDITION_NOMATCH + * if the header does not match, AP_CONDITION_STRONG for a strong + * match. Weak matches are not permitted for the If-Match header. + */ +AP_DECLARE(ap_condition_e) ap_condition_if_match(request_rec *r, + apr_table_t *headers); + +/** + * Tests conditional request rules for the If-Unmodified-Since header. + * @param r The current request + * @param headers The response headers to check against + * @return AP_CONDITION_NONE if the header is missing, AP_CONDITION_NOMATCH + * if the header does not match, AP_CONDITION_WEAK if a weak match + * was present and allowed by RFC2616, AP_CONDITION_STRONG for a + * strong match. + */ +AP_DECLARE(ap_condition_e) ap_condition_if_unmodified_since(request_rec *r, + apr_table_t *headers); + +/** + * Tests conditional request rules for the If-None-Match header. + * @param r The current request + * @param headers The response headers to check against + * @return AP_CONDITION_NONE if the header is missing, AP_CONDITION_NOMATCH + * if the header does not match, AP_CONDITION_WEAK if a weak match + * was present and allowed by RFC2616, AP_CONDITION_STRONG for a + * strong match. + */ +AP_DECLARE(ap_condition_e) ap_condition_if_none_match(request_rec *r, + apr_table_t *headers); + +/** + * Tests conditional request rules for the If-Modified-Since header. + * @param r The current request + * @param headers The response headers to check against + * @return AP_CONDITION_NONE if the header is missing, AP_CONDITION_NOMATCH + * if the header does not match, AP_CONDITION_WEAK if a weak match + * was present and allowed by RFC2616, AP_CONDITION_STRONG for a + * strong match. + */ +AP_DECLARE(ap_condition_e) ap_condition_if_modified_since(request_rec *r, + apr_table_t *headers); + +/** + * Tests conditional request rules for the If-Range header. + * @param r The current request + * @param headers The response headers to check against + * @return AP_CONDITION_NONE if either the If-Range or Range header is + * missing, AP_CONDITION_NOMATCH if the header does not match, + * AP_CONDITION_STRONG for a strong match. Weak matches are not + * permitted for the If-Range header. + */ +AP_DECLARE(ap_condition_e) ap_condition_if_range(request_rec *r, + apr_table_t *headers); + /** * Implements condition GET rules for HTTP/1.1 specification. This function * inspects the client headers and determines if the response fulfills diff --git a/include/http_request.h b/include/http_request.h index a81e7538..1884fbef 100644 --- a/include/http_request.h +++ b/include/http_request.h @@ -528,6 +528,25 @@ AP_DECLARE(void) ap_hook_check_authz(ap_HOOK_auth_checker_t *pf, */ AP_DECLARE_HOOK(void,insert_filter,(request_rec *r)) +/** + * This hook allows modules to affect the request immediately after the + * per-directory configuration for the request has been generated. + * @param r The current request + * @return OK (allow acces), DECLINED (let later modules decide), + * or HTTP_... (deny access) + * @ingroup hooks + */ +AP_DECLARE_HOOK(int,post_perdir_config,(request_rec *r)) + +/** + * This hook allows modules to handle/emulate the apr_stat() calls + * needed for directory walk. + * @param r The current request + * @return apr_status_t or AP_DECLINED (let later modules decide) + * @ingroup hooks + */ +AP_DECLARE_HOOK(apr_status_t,dirwalk_stat,(apr_finfo_t *finfo, request_rec *r, apr_int32_t wanted)) + AP_DECLARE(int) ap_location_walk(request_rec *r); AP_DECLARE(int) ap_directory_walk(request_rec *r); AP_DECLARE(int) ap_file_walk(request_rec *r); diff --git a/include/httpd.h b/include/httpd.h index 70eb06f9..36cd58d5 100644 --- a/include/httpd.h +++ b/include/httpd.h @@ -1388,7 +1388,7 @@ AP_DECLARE(char *) ap_ht_time(apr_pool_t *p, apr_time_t t, const char *fmt, int char **) */ /** - * Get the characters until the first occurance of a specified character + * Get the characters until the first occurrence of a specified character * @param p The pool to allocate memory from * @param line The string to get the characters from * @param stop The character to stop at @@ -1397,7 +1397,7 @@ AP_DECLARE(char *) ap_ht_time(apr_pool_t *p, apr_time_t t, const char *fmt, int AP_DECLARE(char *) ap_getword(apr_pool_t *p, const char **line, char stop); /** - * Get the characters until the first occurance of a specified character + * Get the characters until the first occurrence of a specified character * @param p The pool to allocate memory from * @param line The string to get the characters from * @param stop The character to stop at @@ -1426,22 +1426,22 @@ AP_DECLARE(char *) ap_getword_white(apr_pool_t *p, const char **line); AP_DECLARE(char *) ap_getword_white_nc(apr_pool_t *p, char **line); /** - * Get all characters from the first occurance of @a stop to the first "\0" + * Get all characters from the first occurrence of @a stop to the first "\0" * @param p The pool to allocate memory from * @param line The line to traverse * @param stop The character to start at - * @return A copy of all caracters after the first occurance of the specified + * @return A copy of all characters after the first occurrence of the specified * character */ AP_DECLARE(char *) ap_getword_nulls(apr_pool_t *p, const char **line, char stop); /** - * Get all characters from the first occurance of @a stop to the first "\0" + * Get all characters from the first occurrence of @a stop to the first "\0" * @param p The pool to allocate memory from * @param line The line to traverse * @param stop The character to start at - * @return A copy of all caracters after the first occurance of the specified + * @return A copy of all characters after the first occurrence of the specified * character * @note The same as ap_getword_nulls(), except it doesn't use const char **. */ @@ -1510,6 +1510,24 @@ AP_DECLARE(char *) ap_get_list_item(apr_pool_t *p, const char **field); AP_DECLARE(int) ap_find_list_item(apr_pool_t *p, const char *line, const char *tok); /** + * Do a weak ETag comparison within an HTTP field value list. + * @param p The pool to allocate from + * @param line The field value list to search + * @param tok The token to search for + * @return 1 if found, 0 if not found. + */ +AP_DECLARE(int) ap_find_etag_weak(apr_pool_t *p, const char *line, const char *tok); + +/** + * Do a strong ETag comparison within an HTTP field value list. + * @param p The pool to allocate from + * @param line The field value list to search + * @param tok The token to search for + * @return 1 if found, 0 if not found. + */ +AP_DECLARE(int) ap_find_etag_strong(apr_pool_t *p, const char *line, const char *tok); + +/** * Retrieve a token, spacing over it and adjusting the pointer to * the first non-white byte afterwards. Note that these tokens * are delimited by semis and commas and can also be delimited @@ -1853,7 +1871,7 @@ AP_DECLARE(char *) ap_pregsub(apr_pool_t *p, const char *input, * @param nmatch the nmatch returned from ap_pregex * @param pmatch the pmatch array returned from ap_pregex * @param maxlen the maximum string length to return, 0 for unlimited - * @return The substituted string, or NULL on error + * @return APR_SUCCESS if successful, APR_ENOMEM or other error code otherwise. */ AP_DECLARE(apr_status_t) ap_pregsub_ex(apr_pool_t *p, char **result, const char *input, const char *source, @@ -2093,12 +2111,6 @@ extern int raise_sigstop_flags; */ AP_DECLARE(const char *) ap_psignature(const char *prefix, request_rec *r); -/** strtoul does not exist on sunos4. */ -#ifdef strtoul -#undef strtoul -#endif -#define strtoul strtoul_is_not_a_portable_function_use_strtol_instead - /* The C library has functions that allow const to be silently dropped ... these macros detect the drop in maintainer mode, but use the native methods for normal builds @@ -2218,6 +2230,18 @@ AP_DECLARE(void) ap_get_loadavg(ap_loadavg_t *ld); */ AP_DECLARE(void) ap_bin2hex(const void *src, apr_size_t srclen, char *dest); +/** + * Short function to execute a command and return the first line of + * output minus \r \n. Useful for "obscuring" passwords via exec calls + * @param p the pool to allocate from + * @param cmd the command to execute + * @param argv the arguments to pass to the cmd + * @return ptr to characters or NULL on any error + */ +AP_DECLARE(char *) ap_get_exec_line(apr_pool_t *p, + const char *cmd, + const char * const *argv); + #define AP_NORESTART APR_OS_START_USEERR + 1 #ifdef __cplusplus diff --git a/include/util_filter.h b/include/util_filter.h index 5f6f9afa..5a966074 100644 --- a/include/util_filter.h +++ b/include/util_filter.h @@ -332,8 +332,8 @@ AP_DECLARE(apr_status_t) ap_pass_brigade(ap_filter_t *filter, AP_DECLARE(apr_status_t) ap_pass_brigade_fchk(request_rec *r, apr_bucket_brigade *bucket, const char *fmt, - ...); - + ...) + __attribute__((format(printf,3,4))); /** * This function is used to register an input filter with the system. @@ -486,6 +486,25 @@ AP_DECLARE(void) ap_remove_input_filter(ap_filter_t *f); AP_DECLARE(void) ap_remove_output_filter(ap_filter_t *f); +/** + * Remove an input filter from either the request or connection stack + * it is associated with. + * @param next The filter stack to search + * @param handle The filter handle (name) to remove + * @return APR_SUCCESS on removal or error + */ +AP_DECLARE(apr_status_t) ap_remove_input_filter_byhandle(ap_filter_t *next, + const char *handle); +/** + * Remove an output filter from either the request or connection stack + * it is associated with. + * @param next The filter stack to search + * @param handle The filter handle (name) to remove + * @return APR_SUCCESS on removal or error + */ +AP_DECLARE(apr_status_t) ap_remove_output_filter_byhandle(ap_filter_t *next, + const char *handle); + /* The next two filters are for abstraction purposes only. They could be * done away with, but that would require that we break modules if we ever * want to change our filter registration method. The basic idea, is that |