You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tcl.apache.org by mx...@apache.org on 2019/01/21 10:13:37 UTC

[tcl-rivet] 02/02: error message buffer size definitions now using RIVET_MSG_BUFFER_SIZE

This is an automated email from the ASF dual-hosted git repository.

mxmanghi pushed a commit to branch 3.1
in repository https://gitbox.apache.org/repos/asf/tcl-rivet.git

commit ad9cffb2bf991135de3c9410d2f087549664284d
Author: Massimo Manghi <mx...@apache.org>
AuthorDate: Mon Jan 21 11:09:09 2019 +0100

    error message buffer size definitions now using RIVET_MSG_BUFFER_SIZE
---
 ChangeLog                           |  6 ++++--
 src/mod_rivet_ng/rivetCore.c        |  4 ++--
 src/mod_rivet_ng/rivet_worker_mpm.c | 13 ++++++-------
 3 files changed, 12 insertions(+), 11 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 7da48fe..bb9dd47 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,8 @@
 2019-01-21 Massimo Manghi <mx...@apache.org>
-    * src/rivet.h: Add error message buffer size definition (was still hardcoded
-    here and there)
+	* src/rivet.h: Add error message buffer size definition (was still hardcoded
+	here and there)
+	* src/mod_rivet_ng/rivetCore.c,rivet_worker_mpm.c: hardcoded buffer size into
+	their correct macro definitions
 
 2019-01-09 Massimo Manghi <mx...@apache.org>
     * .: Released as 3.1.1
diff --git a/src/mod_rivet_ng/rivetCore.c b/src/mod_rivet_ng/rivetCore.c
index 66cb9d8..c499772 100644
--- a/src/mod_rivet_ng/rivetCore.c
+++ b/src/mod_rivet_ng/rivetCore.c
@@ -278,9 +278,9 @@ TCL_CMD_HEADER( Rivet_Parse )
     stat_s = apr_stat(&finfo_b,filename,APR_FINFO_NORM,private->r->pool);
     if (stat_s != APR_SUCCESS)
     {
-        char apr_error_message[256];
+        char apr_error_message[RIVET_MSG_BUFFER_SIZE];
 
-        Tcl_AddErrorInfo(interp,apr_strerror(stat_s,apr_error_message,256));
+        Tcl_AddErrorInfo(interp,apr_strerror(stat_s,apr_error_message,RIVET_MSG_BUFFER_SIZE));
         return TCL_ERROR;
     }
 
diff --git a/src/mod_rivet_ng/rivet_worker_mpm.c b/src/mod_rivet_ng/rivet_worker_mpm.c
index 7c36afe..0f94202 100644
--- a/src/mod_rivet_ng/rivet_worker_mpm.c
+++ b/src/mod_rivet_ng/rivet_worker_mpm.c
@@ -313,9 +313,9 @@ static void start_thread_pool (int nthreads)
 
         if (rv != APR_SUCCESS) 
         {
-            char    errorbuf[512];
+            char    errorbuf[RIVET_MSG_BUFFER_SIZE];
 
-            apr_strerror(rv, errorbuf,200);
+            apr_strerror(rv, errorbuf,RIVET_MSG_BUFFER_SIZE);
             ap_log_error(APLOG_MARK, APLOG_ERR, APR_EGENERAL, module_globals->server, 
                 "Error starting request_processor thread (%d) rv=%d:%s\n",i,rv,errorbuf);
             exit(1);
@@ -409,18 +409,17 @@ static void* APR_THREAD_FUNC threaded_bridge_supervisor (apr_thread_t *thd, void
 
                     rv = create_worker_thread (&((apr_thread_t **)mpm->workers)[i]);
                     if (rv != APR_SUCCESS) {
-                        char errorbuf[512];
+                        char errorbuf[RIVET_MSG_BUFFER_SIZE];
 
                         /* we shouldn't ever be in the condition of not being able to start a new thread
                          * Whatever is the reason we log a message and terminate the whole process
                          */
 
-                        apr_strerror(rv,errorbuf,200);
+                        apr_strerror(rv,errorbuf,RIVET_MSG_BUFFER_SIZE);
                         ap_log_error(APLOG_MARK, APLOG_ERR, APR_EGENERAL, s, 
                             "Error starting request_processor thread (%d) rv=%d:%s",i,rv,errorbuf);
 
                         exit(1);
-
                     }
                     
                     break;
@@ -539,9 +538,9 @@ void Worker_MPM_ChildInit (apr_pool_t* pool, server_rec* server)
                             threaded_bridge_supervisor, server, module_globals->pool);
 
     if (rv != APR_SUCCESS) {
-        char    errorbuf[512];
+        char errorbuf[RIVET_MSG_BUFFER_SIZE];
 
-        apr_strerror(rv, errorbuf,200);
+        apr_strerror(rv, errorbuf,RIVET_MSG_BUFFER_SIZE);
         ap_log_error(APLOG_MARK, APLOG_ERR, rv, server, 
                      MODNAME "Error starting supervisor thread rv=%d:%s\n",rv,errorbuf);
         exit(1);


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@tcl.apache.org
For additional commands, e-mail: commits-help@tcl.apache.org