From: Christophe Jaillet Date: Tue, 15 Jan 2013 21:53:07 +0000 (+0000) Subject: Log a warning if ThreadStackSize has an inappropriate value. X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f240baae13f19bd640c5d5a8b932fe752a707998;p=thirdparty%2Fapache%2Fhttpd.git Log a warning if ThreadStackSize has an inappropriate value. PR : 54311 Submitted by: Tianyin Xu Only event.c has been compiled on my system. The 2 others are just cut and paste. I have left the same value for APLOGNO in event and eventopt has for the other logged messages. I don't know if it is the right way to do. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1433682 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/docs/log-message-tags/next-number b/docs/log-message-tags/next-number index ad9c9315237..9243b02f5b5 100644 --- a/docs/log-message-tags/next-number +++ b/docs/log-message-tags/next-number @@ -1 +1 @@ -2435 +2437 diff --git a/server/mpm/event/event.c b/server/mpm/event/event.c index 23d3c0e0105..d2223636eac 100644 --- a/server/mpm/event/event.c +++ b/server/mpm/event/event.c @@ -2217,7 +2217,13 @@ static void child_main(int child_num_arg) apr_threadattr_detach_set(thread_attr, 0); if (ap_thread_stacksize != 0) { - apr_threadattr_stacksize_set(thread_attr, ap_thread_stacksize); + rv = apr_threadattr_stacksize_set(thread_attr, ap_thread_stacksize); + if (rv != APR_SUCCESS && rv != APR_ENOTIMPL) { + ap_log_error(APLOG_MARK, APLOG_WARNING, rv, ap_server_conf, APLOGNO(02436) + "WARNING: ThreadStackSize of %" APR_SIZE_T_FMT " is " + "inappropriate, using default", + ap_thread_stacksize); + } } ts->threads = threads; diff --git a/server/mpm/eventopt/eventopt.c b/server/mpm/eventopt/eventopt.c index 7dcebf3d71e..0ecfc16bed0 100644 --- a/server/mpm/eventopt/eventopt.c +++ b/server/mpm/eventopt/eventopt.c @@ -2222,7 +2222,13 @@ static void child_main(int child_num_arg) apr_threadattr_detach_set(thread_attr, 0); if (ap_thread_stacksize != 0) { - apr_threadattr_stacksize_set(thread_attr, ap_thread_stacksize); + rv = apr_threadattr_stacksize_set(thread_attr, ap_thread_stacksize); + if (rv != APR_SUCCESS && rv != APR_ENOTIMPL) { + ap_log_error(APLOG_MARK, APLOG_WARNING, rv, ap_server_conf, APLOGNO(02436) + "WARNING: ThreadStackSize of %" APR_SIZE_T_FMT " is " + "inappropriate, using default", + ap_thread_stacksize); + } } ts->threads = threads; diff --git a/server/mpm/worker/worker.c b/server/mpm/worker/worker.c index bd105ce307c..47c144d4ef8 100644 --- a/server/mpm/worker/worker.c +++ b/server/mpm/worker/worker.c @@ -1275,7 +1275,13 @@ static void child_main(int child_num_arg) apr_threadattr_detach_set(thread_attr, 0); if (ap_thread_stacksize != 0) { - apr_threadattr_stacksize_set(thread_attr, ap_thread_stacksize); + rv = apr_threadattr_stacksize_set(thread_attr, ap_thread_stacksize); + if (rv != APR_SUCCESS && rv != APR_ENOTIMPL) { + ap_log_error(APLOG_MARK, APLOG_WARNING, rv, ap_server_conf, APLOGNO(02435) + "WARNING: ThreadStackSize of %" APR_SIZE_T_FMT " is " + "inappropriate, using default", + ap_thread_stacksize); + } } ts->threads = threads;