Author: rjung
Date: Sun Sep  2 13:14:53 2007
New Revision: 572140

URL: http://svn.apache.org/viewvc?rev=572140&view=rev
Log:
Simplify validation of attributes from workers.properties
by handling the reference attribute in the usual way.

Modified:
    tomcat/connectors/trunk/jk/native/common/jk_map.c
    tomcat/connectors/trunk/jk/native/common/jk_util.c

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=572140&r1=572139&r2=572140&view=diff
==============================================================================
--- tomcat/connectors/trunk/jk/native/common/jk_map.c (original)
+++ tomcat/connectors/trunk/jk/native/common/jk_map.c Sun Sep  2 13:14:53 2007
@@ -398,22 +398,19 @@
 
 static int jk_map_validate_property(char *prp, jk_logger_t *l)
 {
-    int off = (int)strlen(prp) - (int)JK_MAP_REFERENCE_SZ;
     /* check the worker properties */
-    if (off <= 0 || strncmp(&prp[off], JK_MAP_REFERENCE, JK_MAP_REFERENCE_SZ) 
) {
-        if (!jk_is_valid_property(prp)) {
-            jk_log(l, JK_LOG_ERROR,
-                   "The attribute '%s' is not supported - please check"
-                   " the documentation for the supported attributes.",
-                   prp);
-            return JK_FALSE;
-        }
-        if (jk_is_deprecated_property(prp)) {
-            jk_log(l, JK_LOG_WARNING,
-                   "The attribute '%s' is deprecated - please check"
-                   " the documentation for the correct replacement.",
-                   prp);
-        }
+    if (!jk_is_valid_property(prp)) {
+        jk_log(l, JK_LOG_ERROR,
+               "The attribute '%s' is not supported - please check"
+               " the documentation for the supported attributes.",
+               prp);
+        return JK_FALSE;
+    }
+    if (jk_is_deprecated_property(prp)) {
+        jk_log(l, JK_LOG_WARNING,
+               "The attribute '%s' is deprecated - please check"
+               " the documentation for the correct replacement.",
+               prp);
     }
     return JK_TRUE;
 }

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=572140&r1=572139&r2=572140&view=diff
==============================================================================
--- tomcat/connectors/trunk/jk/native/common/jk_util.c (original)
+++ tomcat/connectors/trunk/jk/native/common/jk_util.c Sun Sep  2 13:14:53 2007
@@ -43,6 +43,7 @@
 #define LIBPATH_OF_WORKER           ("ld_path")
 #define CMD_LINE_OF_WORKER          ("cmd_line")
 #define NATIVE_LIB_OF_WORKER        ("native_lib")
+#define REFERENCE_OF_WORKER         ("reference")
 #define HOST_OF_WORKER              ("host")
 #define PORT_OF_WORKER              ("port")
 #define TYPE_OF_WORKER              ("type")
@@ -157,6 +158,7 @@
 
 static const char *unique_properties[] = {
     SECRET_OF_WORKER,
+    REFERENCE_OF_WORKER,
     HOST_OF_WORKER,
     PORT_OF_WORKER,
     TYPE_OF_WORKER,
@@ -239,6 +241,7 @@
     LIBPATH_OF_WORKER,
     CMD_LINE_OF_WORKER,
     NATIVE_LIB_OF_WORKER,
+    REFERENCE_OF_WORKER,
     HOST_OF_WORKER,
     PORT_OF_WORKER,
     TYPE_OF_WORKER,



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to