* 20140207.5 (2.5.0-dev) Add ap_mpm_resume_suspended(), AP_MPMQ_CAN_SUSPEND to
* ap_mpm_query(), and suspended_baton to conn_rec
* 20140207.6 (2.5.0-dev) Added ap_log_common().
+ * 20140207.7 (2.5.0-dev) Added ap_force_set_tz().
*/
#define MODULE_MAGIC_COOKIE 0x41503235UL /* "AP25" */
#ifndef MODULE_MAGIC_NUMBER_MAJOR
#define MODULE_MAGIC_NUMBER_MAJOR 20140207
#endif
-#define MODULE_MAGIC_NUMBER_MINOR 6 /* 0...n */
+#define MODULE_MAGIC_NUMBER_MINOR 7 /* 0...n */
/**
* Determine if the server's current MODULE_MAGIC_NUMBER is at least a
*/
AP_DECLARE(apr_status_t) ap_recent_rfc822_date(char *date_str, apr_time_t t);
+/**
+ * Force an unset TZ to UTC
+ * @param p the pool to use
+ */
+AP_DECLARE(void) ap_force_set_tz(apr_pool_t *p);
+
#ifdef __cplusplus
}
#endif
#include "apr_atomic.h"
#define APR_WANT_STRFUNC
#include "apr_want.h"
-#include "apr_env.h"
#include "apr_version.h"
#include "http_vhost.h"
#include "unixd.h"
#include "apr_skiplist.h"
+#include "util_time.h"
#include <signal.h>
#include <limits.h> /* for INT_MAX */
}
}
-static void force_set_tz(apr_pool_t *p) {
- /* If the TZ variable is unset, many operationg systems,
- * such as Linux, will at runtime read from /etc/localtime
- * and call fstat on it.
- *
- * By forcing the time zone to UTC if it is unset, we gain
- * about 2% in raw requests/second (since we format log files
- * in the local time, if present)
- *
- * For more info, see:
- * <http://www.gnu.org/s/hello/manual/libc/TZ-Variable.html>
- */
- char *v = NULL;
-
- if (apr_env_get(&v, "TZ", p) != APR_SUCCESS) {
- apr_env_set("TZ", "UTC+0", p);
- }
-}
-
static void child_main(int child_num_arg)
{
apr_thread_t **threads;
*/
static const char *const aszSucc[] = { "core.c", NULL };
one_process = 0;
- force_set_tz(p);
+ ap_force_set_tz(p);
ap_hook_open_logs(event_open_logs, NULL, aszSucc, APR_HOOK_REALLY_FIRST);
/* we need to set the MPM state before other pre-config hooks use MPM query
#include "apr_atomic.h"
#define APR_WANT_STRFUNC
#include "apr_want.h"
-#include "apr_env.h"
#if APR_HAVE_UNISTD_H
#include <unistd.h>
#include "mpm_default.h"
#include "http_vhost.h"
#include "unixd.h"
+#include "util_time.h"
#include <signal.h>
#include <limits.h> /* for INT_MAX */
}
}
-static void force_set_tz(apr_pool_t *p) {
- /* If the TZ variable is unset, many operationg systems,
- * such as Linux, will at runtime read from /etc/localtime
- * and call fstat on it.
- *
- * By forcing the time zone to UTC if it is unset, we gain
- * about 2% in raw requests/second (since we format log files
- * in the local time, if present)
- *
- * For more info, see:
- * <http://www.gnu.org/s/hello/manual/libc/TZ-Variable.html>
- */
- char *v = NULL;
-
- if (apr_env_get(&v, "TZ", p) != APR_SUCCESS) {
- apr_env_set("TZ", "UTC+0", p);
- }
-}
-
static void child_main(int child_num_arg)
{
apr_thread_t **threads;
*/
static const char *const aszSucc[] = { "core.c", NULL };
one_process = 0;
- force_set_tz(p);
+ ap_force_set_tz(p);
ap_hook_open_logs(event_open_logs, NULL, aszSucc, APR_HOOK_REALLY_FIRST);
/* we need to set the MPM state before other pre-config hooks use MPM query
#include "ap_listen.h"
#include "ap_mmn.h"
#include "apr_poll.h"
+#include "util_time.h"
#include <stdlib.h>
* console.
*/
static const char *const aszSucc[] = {"core.c", NULL};
+ ap_force_set_tz(p);
ap_hook_open_logs(prefork_open_logs, NULL, aszSucc, APR_HOOK_REALLY_FIRST);
/* we need to set the MPM state before other pre-config hooks use MPM query
#include "mpm_default.h"
#include "util_mutex.h"
#include "unixd.h"
+#include "util_time.h"
#include <signal.h>
#include <limits.h> /* for INT_MAX */
*/
static const char *const aszSucc[] = {"core.c", NULL};
one_process = 0;
+ ap_force_set_tz(p);
ap_hook_open_logs(worker_open_logs, NULL, aszSucc, APR_HOOK_REALLY_FIRST);
/* we need to set the MPM state before other pre-config hooks use MPM query
*/
#include "util_time.h"
+#include "apr_env.h"
+
/* Number of characters needed to format the microsecond part of a timestamp.
*date_str++ = 0;
return APR_SUCCESS;
}
+
+AP_DECLARE(void) ap_force_set_tz(apr_pool_t *p) {
+ /* If the TZ variable is unset, many operationg systems,
+ * such as Linux, will at runtime read from /etc/localtime
+ * and call fstat on it.
+ *
+ * By forcing the time zone to UTC if it is unset, we gain
+ * about 2% in raw requests/second (since we format log files
+ * in the local time, if present)
+ *
+ * For more info, see:
+ * <http://www.gnu.org/s/hello/manual/libc/TZ-Variable.html>
+ */
+ char *v = NULL;
+
+ if (apr_env_get(&v, "TZ", p) != APR_SUCCESS) {
+ apr_env_set("TZ", "UTC+0", p);
+ }
+}