tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rj...@apache.org
Subject svn commit: r608429 - in /tomcat/connectors/trunk/jk: native/common/jk_ajp12_worker.c native/common/jk_map.c native/common/jk_status.c native/common/jk_util.c xdocs/miscellaneous/changelog.xml
Date Thu, 03 Jan 2008 10:44:22 GMT
Author: rjung
Date: Thu Jan  3 02:44:21 2008
New Revision: 608429

URL: http://svn.apache.org/viewvc?rev=608429&view=rev
Log:
Use thread safe strtok_r on more platforms, especially AIX.
Detect multi threaded context using define _MT_CODE_PTHREAD
instead of _REENTRANT, which is not used on all platforms.

Modified:
    tomcat/connectors/trunk/jk/native/common/jk_ajp12_worker.c
    tomcat/connectors/trunk/jk/native/common/jk_map.c
    tomcat/connectors/trunk/jk/native/common/jk_status.c
    tomcat/connectors/trunk/jk/native/common/jk_util.c
    tomcat/connectors/trunk/jk/xdocs/miscellaneous/changelog.xml

Modified: tomcat/connectors/trunk/jk/native/common/jk_ajp12_worker.c
URL: http://svn.apache.org/viewvc/tomcat/connectors/trunk/jk/native/common/jk_ajp12_worker.c?rev=608429&r1=608428&r2=608429&view=diff
==============================================================================
--- tomcat/connectors/trunk/jk/native/common/jk_ajp12_worker.c (original)
+++ tomcat/connectors/trunk/jk/native/common/jk_ajp12_worker.c Thu Jan  3 02:44:21 2008
@@ -540,7 +540,7 @@
         char *line = NULL;
         char *name = NULL;
         char *value = NULL;
-#ifdef _REENTRANT
+#ifdef _MT_CODE_PTHREAD
         char *lasts;
 #endif
 
@@ -588,7 +588,7 @@
         jk_log(l, JK_LOG_DEBUG, "ajpv12_handle_response, read %s=%s", name,
                value);
         if (0 == strcmp("Status", name)) {
-#ifdef _REENTRANT
+#ifdef _MT_CODE_PTHREAD
             char *numeric = strtok_r(value, " \t", &lasts);
 #else
             char *numeric = strtok(value, " \t");
@@ -600,7 +600,7 @@
                        "ajpv12_handle_response, invalid status code");
                 return JK_FALSE;
             }
-#ifdef _REENTRANT
+#ifdef _MT_CODE_PTHREAD
             reason = jk_pool_strdup(s->pool, strtok_r(NULL, " \t", &lasts));
 #else
             reason = jk_pool_strdup(s->pool, strtok(NULL, " \t"));

Modified: tomcat/connectors/trunk/jk/native/common/jk_map.c
URL: http://svn.apache.org/viewvc/tomcat/connectors/trunk/jk/native/common/jk_map.c?rev=608429&r1=608428&r2=608429&view=diff
==============================================================================
--- tomcat/connectors/trunk/jk/native/common/jk_map.c (original)
+++ tomcat/connectors/trunk/jk/native/common/jk_map.c Thu Jan  3 02:44:21 2008
@@ -249,7 +249,7 @@
     const char *l = jk_map_get_string(m, name, def);
     char **ar = NULL;
 
-#ifdef _REENTRANT
+#ifdef _MT_CODE_PTHREAD
     char *lasts;
 #endif
 
@@ -269,7 +269,7 @@
          * GS, in addition to VG's patch, we now need to
          * strtok also by a "*"
          */
-#ifdef _REENTRANT
+#ifdef _MT_CODE_PTHREAD
         for (p = strtok_r(v, " \t,", &lasts);
              p; p = strtok_r(NULL, " \t,", &lasts))
 #else
@@ -305,7 +305,7 @@
 {
     const char *l = jk_map_get_string(m, name, def);
 
-#ifdef _REENTRANT
+#ifdef _MT_CODE_PTHREAD
     char *lasts;
 #endif
 
@@ -326,7 +326,7 @@
          * GS, in addition to VG's patch, we now need to
          * strtok also by a "*"
          */
-#ifdef _REENTRANT
+#ifdef _MT_CODE_PTHREAD
         for (p = strtok_r(v, " \t,", &lasts);
              p; p = strtok_r(NULL, " \t,", &lasts))
 #else

Modified: tomcat/connectors/trunk/jk/native/common/jk_status.c
URL: http://svn.apache.org/viewvc/tomcat/connectors/trunk/jk/native/common/jk_status.c?rev=608429&r1=608428&r2=608429&view=diff
==============================================================================
--- tomcat/connectors/trunk/jk/native/common/jk_status.c (original)
+++ tomcat/connectors/trunk/jk/native/common/jk_status.c Thu Jan  3 02:44:21 2008
@@ -929,7 +929,7 @@
 {
     jk_map_t *m;
     status_worker_t *w = p->worker;
-#ifdef _REENTRANT
+#ifdef _MT_CODE_PTHREAD_MT_CODE_PTHREAD
     char *lasts;
 #endif
     char *param;
@@ -978,7 +978,7 @@
         return JK_FALSE;
     }
 
-#ifdef _REENTRANT
+#ifdef _MT_CODE_PTHREAD_MT_CODE_PTHREAD
     for (param = strtok_r(query, "&", &lasts);
          param; param = strtok_r(NULL, "&", &lasts)) {
 #else

Modified: tomcat/connectors/trunk/jk/native/common/jk_util.c
URL: http://svn.apache.org/viewvc/tomcat/connectors/trunk/jk/native/common/jk_util.c?rev=608429&r1=608428&r2=608429&view=diff
==============================================================================
--- tomcat/connectors/trunk/jk/native/common/jk_util.c (original)
+++ tomcat/connectors/trunk/jk/native/common/jk_util.c Thu Jan  3 02:44:21 2008
@@ -1756,7 +1756,7 @@
 char **jk_parse_sysprops(jk_pool_t *p, const char *sysprops)
 {
     char **rc = NULL;
-#ifdef _REENTRANT
+#ifdef _MT_CODE_PTHREAD
     char *lasts;
 #endif
 
@@ -1774,7 +1774,7 @@
             rc = jk_pool_alloc(p, (num_of_prps + 1) * sizeof(char *));
             if (rc) {
                 unsigned i = 0;
-#ifdef _REENTRANT
+#ifdef _MT_CODE_PTHREAD
                 char *tmp = strtok_r(prps, "*", &lasts);
 #else
                 char *tmp = strtok(prps, "*");
@@ -1782,7 +1782,7 @@
 
                 while (tmp && i < num_of_prps) {
                     rc[i] = tmp;
-#ifdef _REENTRANT
+#ifdef _MT_CODE_PTHREAD
                     tmp = strtok_r(NULL, "*", &lasts);
 #else
                     tmp = strtok(NULL, "*");

Modified: tomcat/connectors/trunk/jk/xdocs/miscellaneous/changelog.xml
URL: http://svn.apache.org/viewvc/tomcat/connectors/trunk/jk/xdocs/miscellaneous/changelog.xml?rev=608429&r1=608428&r2=608429&view=diff
==============================================================================
--- tomcat/connectors/trunk/jk/xdocs/miscellaneous/changelog.xml (original)
+++ tomcat/connectors/trunk/jk/xdocs/miscellaneous/changelog.xml Thu Jan  3 02:44:21 2008
@@ -43,6 +43,9 @@
   <br />
   <subsection name="Native">
     <changelog>
+      <fix>
+        Use thread safe strtok_r on more platforms, especially AIX. (rjung)
+      </fix>
       <update>
         Status: Improve XSS hardening. (rjung)
       </update>



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message