PATCHES ACCEPTED TO BACKPORT FROM TRUNK:
[ start all new proposals below, under PATCHES PROPOSED. ]
- *) Easy patches: synch 2.4.x and trunk
- - core/log: don't ignore some apr_procattr failures (clang scan-build)
- - doxygen improvements
- - core: Standardize order of "extern" and XXX_DECLARE_YYY
- - mod_mime_magic: Fix some compilation warning when MIME_MAGIC_DEBUG is defined.
- - mod_alias: style: cmd_rec at the bottom
- - core: Fix a typo in a message
- - mpm_winnt: malloc -> ap_malloc
- - mod_usertrack: Slighly simplify code
- - code: Parentheses around AP_BUCKET_IS_EOR argument
- - mod_dialup: Fix a typo
- trunk patch:
- - http://svn.apache.org/r1534995
- - http://svn.apache.org/r1560482
- - http://svn.apache.org/r1728779
- - http://svn.apache.org/r1805491
- - http://svn.apache.org/r1861528
- - http://svn.apache.org/r1868016
- - http://svn.apache.org/r1874470
- - http://svn.apache.org/r1874602
- - http://svn.apache.org/r1875769
- - http://svn.apache.org/r1875811
- 2.4.x patch: svn merge -c 1534995,1560482,1728779,1805491,1861528,1868016,1874470,1874602,1875769,1875811 ^/httpd/httpd/trunk .
- +1: jailletc36, gbechis, jim
-
*) core: default_handler: cleanup outputed brigade before leaving.
trunk patch:
- http://svn.apache.org/r1783041
* @param plog the log pool, reset after the config file is read
* @param server_conf the global server config.
* @return DONE for shutdown OK otherwise.
+ * @ingroup hooks
*/
AP_DECLARE_HOOK(int, mpm, (apr_pool_t *pconf, apr_pool_t *plog, server_rec *server_conf))
apr_procattr_t *attr,
apr_pool_t *p);
-/* Subtypes/Values for AP_MPMQ_IS_THREADED and AP_MPMQ_IS_FORKED */
-#define AP_MPMQ_NOT_SUPPORTED 0 /* This value specifies that an */
- /* MPM is not capable of */
- /* threading or forking. */
-#define AP_MPMQ_STATIC 1 /* This value specifies that */
- /* an MPM is using a static */
- /* number of threads or daemons */
-#define AP_MPMQ_DYNAMIC 2 /* This value specifies that */
- /* an MPM is using a dynamic */
- /* number of threads or daemons */
-
-/* Values returned for AP_MPMQ_MPM_STATE */
+/** @defgroup mpmq MPM query
+ * @{
+ */
+
+/** @defgroup thrdfrk Subtypes/Values returned for AP_MPMQ_IS_THREADED and AP_MPMQ_IS_FORKED
+ * @ingroup mpmq
+ * @{
+ */
+#define AP_MPMQ_NOT_SUPPORTED 0 /**< This value specifies that an
+ * MPM is not capable of
+ * threading or forking. */
+#define AP_MPMQ_STATIC 1 /**< This value specifies that
+ * an MPM is using a static
+ * number of threads or daemons */
+#define AP_MPMQ_DYNAMIC 2 /**< This value specifies that
+ * an MPM is using a dynamic
+ * number of threads or daemons */
+/** @} */
+
+/** @defgroup qstate Values returned for AP_MPMQ_MPM_STATE
+ * @ingroup mpmq
+ * @{
+ */
#define AP_MPMQ_STARTING 0
#define AP_MPMQ_RUNNING 1
#define AP_MPMQ_STOPPING 2
+/** @} */
-#define AP_MPMQ_MAX_DAEMON_USED 1 /* Max # of daemons used so far */
-#define AP_MPMQ_IS_THREADED 2 /* MPM can do threading */
-#define AP_MPMQ_IS_FORKED 3 /* MPM can do forking */
-#define AP_MPMQ_HARD_LIMIT_DAEMONS 4 /* The compiled max # daemons */
-#define AP_MPMQ_HARD_LIMIT_THREADS 5 /* The compiled max # threads */
-#define AP_MPMQ_MAX_THREADS 6 /* # of threads/child by config */
-#define AP_MPMQ_MIN_SPARE_DAEMONS 7 /* Min # of spare daemons */
-#define AP_MPMQ_MIN_SPARE_THREADS 8 /* Min # of spare threads */
-#define AP_MPMQ_MAX_SPARE_DAEMONS 9 /* Max # of spare daemons */
-#define AP_MPMQ_MAX_SPARE_THREADS 10 /* Max # of spare threads */
-#define AP_MPMQ_MAX_REQUESTS_DAEMON 11 /* Max # of requests per daemon */
-#define AP_MPMQ_MAX_DAEMONS 12 /* Max # of daemons by config */
-#define AP_MPMQ_MPM_STATE 13 /* starting, running, stopping */
-#define AP_MPMQ_IS_ASYNC 14 /* MPM can process async connections */
-#define AP_MPMQ_GENERATION 15 /* MPM generation */
-#define AP_MPMQ_HAS_SERF 16 /* MPM can drive serf internally */
+/** @defgroup qcodes Query codes for ap_mpm_query()
+ * @ingroup mpmq
+ * @{
+ */
+/** Max # of daemons used so far */
+#define AP_MPMQ_MAX_DAEMON_USED 1
+/** MPM can do threading */
+#define AP_MPMQ_IS_THREADED 2
+/** MPM can do forking */
+#define AP_MPMQ_IS_FORKED 3
+/** The compiled max # daemons */
+#define AP_MPMQ_HARD_LIMIT_DAEMONS 4
+/** The compiled max # threads */
+#define AP_MPMQ_HARD_LIMIT_THREADS 5
+/** \# of threads/child by config */
+#define AP_MPMQ_MAX_THREADS 6
+/** Min # of spare daemons */
+#define AP_MPMQ_MIN_SPARE_DAEMONS 7
+/** Min # of spare threads */
+#define AP_MPMQ_MIN_SPARE_THREADS 8
+/** Max # of spare daemons */
+#define AP_MPMQ_MAX_SPARE_DAEMONS 9
+/** Max # of spare threads */
+#define AP_MPMQ_MAX_SPARE_THREADS 10
+/** Max # of requests per daemon */
+#define AP_MPMQ_MAX_REQUESTS_DAEMON 11
+/** Max # of daemons by config */
+#define AP_MPMQ_MAX_DAEMONS 12
+/** starting, running, stopping */
+#define AP_MPMQ_MPM_STATE 13
+/** MPM can process async connections */
+#define AP_MPMQ_IS_ASYNC 14
+/** MPM generation */
+#define AP_MPMQ_GENERATION 15
+/** MPM can drive serf internally */
+#define AP_MPMQ_HAS_SERF 16
+/** @} */
/**
* Query a property of the current MPM.
- * @param query_code One of APM_MPMQ_*
+ * @param query_code One of AP_MPMQ_*
* @param result A location to place the result of the query
* @return APR_EGENERAL if an mpm-query hook has not been registered;
* APR_SUCCESS or APR_ENOTIMPL otherwise
*/
AP_DECLARE(apr_status_t) ap_mpm_query(int query_code, int *result);
+/** @} */
typedef void (ap_mpm_callback_fn_t)(void *baton);
* scoreboard slot.
* @param state One of the mpm_child_status values. Modules should ignore
* unrecognized values.
+ * @ingroup hooks
*/
AP_DECLARE_HOOK(void,child_status,(server_rec *s, pid_t pid, ap_generation_t gen,
int slot, mpm_child_status state))
*
* @param s The main server_rec.
* @param gen The server generation which is now completely finished.
+ * @ingroup hooks
*/
AP_DECLARE_HOOK(void,end_generation,(server_rec *s, ap_generation_t gen))
pid_t pid;
} ap_exception_info_t;
+/**
+ * Run the fatal_exception hook for each module; this hook is run
+ * from some MPMs in the event of a child process crash, if the
+ * server was built with --enable-exception-hook and the
+ * EnableExceptionHook directive is On.
+ * @param ei information about the exception
+ * @ingroup hooks
+ */
AP_DECLARE_HOOK(int,fatal_exception,(ap_exception_info_t *ei))
#endif /*AP_ENABLE_EXCEPTION_HOOK*/
* Return an array of named regex backreferences
* @param preg The precompiled regex
* @param names The array to which the names will be added
+ * @param prefix An optional prefix to add to the returned names. AP_REG_MATCH
+ * is the recommended prefix.
* @param upper If non zero, uppercase the names
*/
AP_DECLARE(int) ap_regname(const ap_regex_t *preg,
* Run the header parser functions for each module
* @param r The current request
* @return OK or DECLINED
+ * @ingroup hooks
*/
AP_DECLARE_HOOK(int,header_parser,(request_rec *r))
* @param plog The logging streams pool
* @param ptemp The temporary pool
* @return OK or DECLINED on success anything else is a error
+ * @ingroup hooks
*/
AP_DECLARE_HOOK(int,pre_config,(apr_pool_t *pconf,apr_pool_t *plog,
apr_pool_t *ptemp))
* @param ptemp The temporary pool
* @param s the server to operate upon
* @return OK or DECLINED on success anything else is a error
+ * @ingroup hooks
*/
AP_DECLARE_HOOK(int,check_config,(apr_pool_t *pconf, apr_pool_t *plog,
apr_pool_t *ptemp, server_rec *s))
* @note To avoid reordering problems due to different buffering, hook
* functions should only apr_file_*() to print to stdout/stderr and
* not simple printf()/fprintf().
- *
+ * @ingroup hooks
*/
AP_DECLARE_HOOK(void,test_config,(apr_pool_t *pconf, server_rec *s))
* @param ptemp The temporary pool
* @param s The list of server_recs
* @return OK or DECLINED on success anything else is a error
+ * @ingroup hooks
*/
AP_DECLARE_HOOK(int,post_config,(apr_pool_t *pconf,apr_pool_t *plog,
apr_pool_t *ptemp,server_rec *s))
* @param ptemp The temporary pool
* @param s The list of server_recs
* @return OK or DECLINED on success anything else is a error
+ * @ingroup hooks
*/
AP_DECLARE_HOOK(int,open_logs,(apr_pool_t *pconf,apr_pool_t *plog,
apr_pool_t *ptemp,server_rec *s))
* Run the child_init functions for each module
* @param pchild The child pool
* @param s The list of server_recs in this server
+ * @ingroup hooks
*/
AP_DECLARE_HOOK(void,child_init,(apr_pool_t *pchild, server_rec *s))
* Run the handler functions for each module
* @param r The request_rec
* @remark non-wildcard handlers should HOOK_MIDDLE, wildcard HOOK_LAST
+ * @ingroup hooks
*/
AP_DECLARE_HOOK(int,handler,(request_rec *r))
* @param lookup_uri Controls whether the caller actually wants content or not.
* lookup is set when the quick_handler is called out of
* ap_sub_req_lookup_uri()
+ * @ingroup hooks
*/
AP_DECLARE_HOOK(int,quick_handler,(request_rec *r, int lookup_uri))
* Retrieve the optional functions for each module.
* This is run immediately before the server starts. Optional functions should
* be registered during the hook registration phase.
+ * @ingroup hooks
*/
AP_DECLARE_HOOK(void,optional_fn_retrieve,(void))
* APR_ENOENT or APR_ENOTDIR if no htaccess file exists,
* AP_DECLINED to let later modules do the opening,
* any other error code on error.
+ * @ingroup hooks
*/
AP_DECLARE_HOOK(apr_status_t,open_htaccess,
(request_rec *r, const char *dir_name, const char *access_name,
* @param e The bucket to inspect
* @return true or false
*/
-#define AP_BUCKET_IS_EOR(e) (e->type == &ap_bucket_type_eor)
+#define AP_BUCKET_IS_EOR(e) ((e)->type == &ap_bucket_type_eor)
/**
* Make the bucket passed in an End Of REQUEST (EOR) bucket
/**
* Short function to execute a command and return the first line of
- * output minus \r \n. Useful for "obscuring" passwords via exec calls
+ * 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 add_redirect_internal(cmd, dirconf, arg1, arg2, arg3, 1);
}
-static const command_rec alias_cmds[] =
-{
- AP_INIT_TAKE12("Alias", add_alias, NULL, RSRC_CONF | ACCESS_CONF,
- "a fakename and a realname, or a realname in a Location"),
- AP_INIT_TAKE12("ScriptAlias", add_alias, "cgi-script", RSRC_CONF | ACCESS_CONF,
- "a fakename and a realname, or a realname in a Location"),
- AP_INIT_TAKE123("Redirect", add_redirect, (void *) HTTP_MOVED_TEMPORARILY,
- OR_FILEINFO,
- "an optional status, then document to be redirected and "
- "destination URL"),
- AP_INIT_TAKE2("AliasMatch", add_alias_regex, NULL, RSRC_CONF,
- "a regular expression and a filename"),
- AP_INIT_TAKE2("ScriptAliasMatch", add_alias_regex, "cgi-script", RSRC_CONF,
- "a regular expression and a filename"),
- AP_INIT_TAKE23("RedirectMatch", add_redirect_regex,
- (void *) HTTP_MOVED_TEMPORARILY, OR_FILEINFO,
- "an optional status, then a regular expression and "
- "destination URL"),
- AP_INIT_TAKE2("RedirectTemp", add_redirect2,
- (void *) HTTP_MOVED_TEMPORARILY, OR_FILEINFO,
- "a document to be redirected, then the destination URL"),
- AP_INIT_TAKE2("RedirectPermanent", add_redirect2,
- (void *) HTTP_MOVED_PERMANENTLY, OR_FILEINFO,
- "a document to be redirected, then the destination URL"),
- {NULL}
-};
-
static int alias_matches(const char *uri, const char *alias_fakename)
{
const char *aliasp = alias_fakename, *urip = uri;
return DECLINED;
}
+static const command_rec alias_cmds[] =
+{
+ AP_INIT_TAKE12("Alias", add_alias, NULL, RSRC_CONF | ACCESS_CONF,
+ "a fakename and a realname, or a realname in a Location"),
+ AP_INIT_TAKE12("ScriptAlias", add_alias, "cgi-script", RSRC_CONF | ACCESS_CONF,
+ "a fakename and a realname, or a realname in a Location"),
+ AP_INIT_TAKE123("Redirect", add_redirect, (void *) HTTP_MOVED_TEMPORARILY,
+ OR_FILEINFO,
+ "an optional status, then document to be redirected and "
+ "destination URL"),
+ AP_INIT_TAKE2("AliasMatch", add_alias_regex, NULL, RSRC_CONF,
+ "a regular expression and a filename"),
+ AP_INIT_TAKE2("ScriptAliasMatch", add_alias_regex, "cgi-script", RSRC_CONF,
+ "a regular expression and a filename"),
+ AP_INIT_TAKE23("RedirectMatch", add_redirect_regex,
+ (void *) HTTP_MOVED_TEMPORARILY, OR_FILEINFO,
+ "an optional status, then a regular expression and "
+ "destination URL"),
+ AP_INIT_TAKE2("RedirectTemp", add_redirect2,
+ (void *) HTTP_MOVED_TEMPORARILY, OR_FILEINFO,
+ "a document to be redirected, then the destination URL"),
+ AP_INIT_TAKE2("RedirectPermanent", add_redirect2,
+ (void *) HTTP_MOVED_PERMANENTLY, OR_FILEINFO,
+ "a document to be redirected, then the destination URL"),
+ {NULL}
+};
+
+
static void register_hooks(apr_pool_t *p)
{
static const char * const aszSucc[]={ "mod_userdir.c",
#if MIME_MAGIC_DEBUG
ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, s, APLOGNO(01516)
- MODNAME ": apprentice conf=%x file=%s m=%s m->next=%s last=%s",
+ MODNAME ": apprentice conf=%pp file=%s m=%s m->next=%s last=%s",
conf,
conf->magicfile ? conf->magicfile : "NULL",
conf->magic ? "set" : "NULL",
#if MIME_MAGIC_DEBUG
ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, serv, APLOGNO(01525)
- MODNAME ": parse line=%d m=%x next=%x cont=%d desc=%s",
+ MODNAME ": parse line=%d m=%pp next=%pp cont=%d desc=%s",
lineno, m, m->next, m->cont_level, m->desc);
#endif /* MIME_MAGIC_DEBUG */
#if MIME_MAGIC_DEBUG
ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, APLOGNO(01529)
- MODNAME ": match conf=%x file=%s m=%s m->next=%s last=%s",
+ MODNAME ": match conf=%pp file=%s m=%s m->next=%s last=%s",
conf,
conf->magicfile ? conf->magicfile : "NULL",
conf->magic ? "set" : "NULL",
#if MIME_MAGIC_DEBUG
rule_counter++;
ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, APLOGNO(01532)
- MODNAME ": line=%d mc=%x mc->next=%x cont=%d desc=%s",
+ MODNAME ": line=%d mc=%pp mc->next=%pp cont=%d desc=%s",
m_cont->lineno, m_cont,
m_cont->next, m_cont->cont_level,
m_cont->desc);
dcfg = (cookie_dir_rec *) apr_pcalloc(p, sizeof(cookie_dir_rec));
dcfg->cookie_name = COOKIE_NAME;
- dcfg->cookie_domain = NULL;
dcfg->style = CT_UNSET;
- dcfg->enabled = 0;
- /* calloc'ed to disabled: samesite, is_secure, is_httponly */
+ /* calloc'ed to disabled: enabled, cookie_domain, samesite, is_secure,
+ * is_httponly */
/* In case the user does not use the CookieName directive,
* we need to compile the regexp for the default cookie name. */
return dcfg;
}
-static const char *set_cookie_enable(cmd_parms *cmd, void *mconfig, int arg)
-{
- cookie_dir_rec *dcfg = mconfig;
-
- dcfg->enabled = arg;
- return NULL;
-}
-
static const char *set_cookie_exp(cmd_parms *parms, void *dummy,
const char *arg)
{
"domain to which this cookie applies"),
AP_INIT_TAKE1("CookieStyle", set_cookie_style, NULL, OR_FILEINFO,
"'Netscape', 'Cookie' (RFC2109), or 'Cookie2' (RFC2965)"),
- AP_INIT_FLAG("CookieTracking", set_cookie_enable, NULL, OR_FILEINFO,
+ AP_INIT_FLAG("CookieTracking", ap_set_flag_slot,
+ (void *)APR_OFFSETOF(cookie_dir_rec, enabled), OR_FILEINFO,
"whether or not to enable cookies"),
AP_INIT_TAKE1("CookieName", set_cookie_name, NULL, OR_FILEINFO,
"name of the tracking cookie"),
PROXY_DECLARE(int) ap_proxy_is_hostname(struct dirconn_entry *This, apr_pool_t *p);
PROXY_DECLARE(int) ap_proxy_is_word(struct dirconn_entry *This, apr_pool_t *p);
-PROXY_DECLARE_DATA extern int proxy_lb_workers;
-PROXY_DECLARE_DATA extern const apr_strmatch_pattern *ap_proxy_strmatch_path;
-PROXY_DECLARE_DATA extern const apr_strmatch_pattern *ap_proxy_strmatch_domain;
+extern PROXY_DECLARE_DATA int proxy_lb_workers;
+extern PROXY_DECLARE_DATA const apr_strmatch_pattern *ap_proxy_strmatch_path;
+extern PROXY_DECLARE_DATA const apr_strmatch_pattern *ap_proxy_strmatch_domain;
/**
* Register optional functions declared within proxy_util.c.
}
if (dcfg->bytes_per_second == 0) {
- return "mod_diaulup: Unknown Modem Standard specified.";
+ return "mod_dialup: Unknown Modem Standard specified.";
}
return NULL;
rc = apr_procattr_child_err_set(procattr, errfile, NULL);
}
- rc = apr_proc_create(procnew, args[0], (const char * const *)args,
- NULL, procattr, p);
+ if (rc == APR_SUCCESS) {
+ rc = apr_proc_create(procnew, args[0], (const char * const *)args,
+ NULL, procattr, p);
+ }
if (rc == APR_SUCCESS) {
apr_pool_note_subprocess(p, procnew, APR_KILL_AFTER_TIMEOUT);
return -1;
}
- args = malloc((ap_server_conf->process->argc + 1) * sizeof (char*));
+ args = ap_malloc((ap_server_conf->process->argc + 1) * sizeof (char*));
memcpy(args + 1, ap_server_conf->process->argv + 1,
(ap_server_conf->process->argc - 1) * sizeof (char*));
- args[0] = malloc(strlen(cmd) + 1);
+ args[0] = ap_malloc(strlen(cmd) + 1);
strcpy(args[0], cmd);
args[ap_server_conf->process->argc] = NULL;
}
else if (deferred_error == rrl_excesswhitespace)
ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, APLOGNO(03448)
"HTTP Request Line; Excess whitespace "
- "(disallowed by HttpProtocolOptions Strict");
+ "(disallowed by HttpProtocolOptions Strict)");
else if (deferred_error == rrl_trailingtext)
ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, APLOGNO(03449)
"HTTP Request Line; Extraneous text found '%.*s' "