Changes with Apache 2.3.0
[ When backported to 2.2.x, remove entry from this file ]
+ *) core: Add ap_timeout_parameter_parse to public API. [Ruediger Pluem]
+
*) mod_proxy: Prevent segmentation faults by correctly flushing all buckets
from the proxy backend. PR 45792 [Ruediger Pluem]
* 20080830.0 (2.3.0-dev) Cookies can be set on headers_out and err_headers_out
* 20080920.0 (2.3.0-dev) Add ap_mpm_register_timed_callback.
* 20080920.1 (2.3.0-dev) Export mod_rewrite.h in the public API.
+ * 20080920.2 (2.3.0-dev) Added ap_timeout_parameter_parse to util.c / httpd.h
*
*/
#ifndef MODULE_MAGIC_NUMBER_MAJOR
#define MODULE_MAGIC_NUMBER_MAJOR 20080920
#endif
-#define MODULE_MAGIC_NUMBER_MINOR 1 /* 0...n */
+#define MODULE_MAGIC_NUMBER_MINOR 2 /* 0...n */
/**
* Determine if the server's current MODULE_MAGIC_NUMBER is at least a
AP_DECLARE(char *) ap_append_pid(apr_pool_t *p, const char *string,
const char *delim);
+/**
+ * Parse a given timeout parameter string into an apr_interval_time_t value.
+ * The unit of the time interval is given as postfix string to the numeric
+ * string. Currently the following units are understood:
+ *
+ * ms : milliseconds
+ * s : seconds
+ * mi[n] : minutes
+ * h : hours
+ *
+ * If no unit is contained in the given timeout parameter the default_time_unit
+ * will be used instead.
+ * @param timeout_parameter The string containing the timeout parameter.
+ * @param timeout The timeout value to be returned.
+ * @param default_time_unit The default time unit to use if none is specified
+ * in timeout_parameter.
+ * @return Status value indicating whether the parsing was successful or not.
+ */
+AP_DECLARE(apr_status_t) ap_timeout_parameter_parse(
+ const char *timeout_parameter,
+ apr_interval_time_t *timeout,
+ const char *default_time_unit);
+
/* Misc system hackery */
/**
* Given the name of an object in the file system determine if it is a directory
return sizeof(proxy_worker_stat);
}
-/**
- * Parse a given timeout parameter string into an apr_interval_time_t value.
- * The unit of the time interval is given as postfix string to the numeric
- * string. Currently the following units are understood:
- *
- * ms : milliseconds
- * s : seconds
- * mi[n] : minutes
- * h : hours
- *
- * If no unit is contained in the given timeout parameter the default_time_unit
- * will be used instead.
- * @param timeout_parameter The string containing the timeout parameter.
- * @param timeout The timeout value to be returned.
- * @param default_time_unit The default time unit to use if none is specified
- * in timeout_parameter.
- * @return Status value indicating whether the parsing was successful or not.
- */
-/*
- * XXX: Once this function has its final status parameter wise it makes sense
- * to move it to some of the util??? files under server/ as public API.
- */
-static apr_status_t ap_timeout_parameter_parse(const char *timeout_parameter,
- apr_interval_time_t *timeout,
- const char *default_time_unit)
-{
- char *endp;
- const char *time_str;
- apr_int64_t tout;
-
- tout = apr_strtoi64(timeout_parameter, &endp, 10);
- if (errno) {
- return errno;
- }
- if (!endp || !*endp) {
- time_str = default_time_unit;
- }
- else {
- time_str = endp;
- }
-
- switch (*time_str) {
- /* Time is in seconds */
- case 's':
- *timeout = (apr_interval_time_t) apr_time_from_sec(tout);
- break;
- case 'h':
- /* Time is in hours */
- *timeout = (apr_interval_time_t) apr_time_from_sec(tout * 3600);
- break;
- case 'm':
- switch (*(++time_str)) {
- /* Time is in miliseconds */
- case 's':
- *timeout = (apr_interval_time_t) tout * 1000;
- break;
- /* Time is in minutes */
- case 'i':
- *timeout = (apr_interval_time_t) apr_time_from_sec(tout * 60);
- break;
- default:
- return APR_EGENERAL;
- }
- break;
- default:
- return APR_EGENERAL;
- }
- return APR_SUCCESS;
-}
-
/*
* A Web proxy module. Stages:
*
delim, getpid());
}
+
+/**
+ * Parse a given timeout parameter string into an apr_interval_time_t value.
+ * The unit of the time interval is given as postfix string to the numeric
+ * string. Currently the following units are understood:
+ *
+ * ms : milliseconds
+ * s : seconds
+ * mi[n] : minutes
+ * h : hours
+ *
+ * If no unit is contained in the given timeout parameter the default_time_unit
+ * will be used instead.
+ * @param timeout_parameter The string containing the timeout parameter.
+ * @param timeout The timeout value to be returned.
+ * @param default_time_unit The default time unit to use if none is specified
+ * in timeout_parameter.
+ * @return Status value indicating whether the parsing was successful or not.
+ */
+AP_DECLARE(apr_status_t) ap_timeout_parameter_parse(
+ const char *timeout_parameter,
+ apr_interval_time_t *timeout,
+ const char *default_time_unit)
+{
+ char *endp;
+ const char *time_str;
+ apr_int64_t tout;
+
+ tout = apr_strtoi64(timeout_parameter, &endp, 10);
+ if (errno) {
+ return errno;
+ }
+ if (!endp || !*endp) {
+ time_str = default_time_unit;
+ }
+ else {
+ time_str = endp;
+ }
+
+ switch (*time_str) {
+ /* Time is in seconds */
+ case 's':
+ *timeout = (apr_interval_time_t) apr_time_from_sec(tout);
+ break;
+ case 'h':
+ /* Time is in hours */
+ *timeout = (apr_interval_time_t) apr_time_from_sec(tout * 3600);
+ break;
+ case 'm':
+ switch (*(++time_str)) {
+ /* Time is in miliseconds */
+ case 's':
+ *timeout = (apr_interval_time_t) tout * 1000;
+ break;
+ /* Time is in minutes */
+ case 'i':
+ *timeout = (apr_interval_time_t) apr_time_from_sec(tout * 60);
+ break;
+ default:
+ return APR_EGENERAL;
+ }
+ break;
+ default:
+ return APR_EGENERAL;
+ }
+ return APR_SUCCESS;
+}
+