tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rj...@apache.org
Subject svn commit: r482060 - in /tomcat/connectors/trunk/jk/native/common: jk_util.c jk_util.h
Date Mon, 04 Dec 2006 04:28:07 GMT
Author: rjung
Date: Sun Dec  3 20:28:07 2006
New Revision: 482060

URL: http://svn.apache.org/viewvc?view=rev&rev=482060
Log:
Cleanup jk_util.c a little:
- num_of_wokers -> num_of_workers
- use "num" instead of "num_*" mostly
Add three more properties for use in status worker:
- prefix to define a prefix for the property output type
- good and bad rating to make the good and bad
  summary for lb in status worker configurable

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

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?view=diff&rev=482060&r1=482059&r2=482060
==============================================================================
--- tomcat/connectors/trunk/jk/native/common/jk_util.c (original)
+++ tomcat/connectors/trunk/jk/native/common/jk_util.c Sun Dec  3 20:28:07 2006
@@ -81,9 +81,12 @@
 #define NAMESPACE_OF_WORKER         ("ns")
 #define XML_NAMESPACE_OF_WORKER     ("xmlns")
 #define XML_DOCTYPE_OF_WORKER       ("doctype")
+#define PROP_PREFIX_OF_WORKER       ("prefix")
 
 #define READ_ONLY_OF_WORKER         ("read_only")
 #define USER_OF_WORKER              ("user")
+#define GOOD_RATING_OF_WORKER       ("good")
+#define BAD_RATING_OF_WORKER        ("bad")
 
 #define DEFAULT_WORKER_TYPE         JK_AJP13_WORKER_NAME
 #define SECRET_KEY_OF_WORKER        ("secretkey")
@@ -131,6 +134,8 @@
     BALANCE_WORKERS,
     MOUNT_OF_WORKER,
     USER_OF_WORKER,
+    GOOD_RATING_OF_WORKER,
+    BAD_RATING_OF_WORKER,
     "list",
     NULL
 };
@@ -174,6 +179,7 @@
     NAMESPACE_OF_WORKER,
     XML_NAMESPACE_OF_WORKER,
     XML_DOCTYPE_OF_WORKER,
+    PROP_PREFIX_OF_WORKER,
     NULL
 };
 
@@ -804,19 +810,19 @@
     return jk_map_get_string(m, buf, NULL);
 }
 
-int jk_get_worker_list(jk_map_t *m, char ***list, unsigned *num_of_wokers)
+int jk_get_worker_list(jk_map_t *m, char ***list, unsigned *num_of_workers)
 {
-    if (m && list && num_of_wokers) {
+    if (m && list && num_of_workers) {
         char **ar = jk_map_get_string_list(m,
                                         WORKER_LIST_PROPERTY_NAME,
-                                        num_of_wokers,
+                                        num_of_workers,
                                         DEFAULT_WORKER);
         if (ar) {
             *list = ar;
             return JK_TRUE;
         }
         *list = NULL;
-        *num_of_wokers = 0;
+        *num_of_workers = 0;
     }
 
     return JK_FALSE;
@@ -1049,6 +1055,16 @@
     return jk_map_get_string(m, buf, def);
 }
 
+const char *jk_get_worker_prop_prefix(jk_map_t *m, const char *wname, const char *def)
+{
+    char buf[1024];
+    if (!m || !wname) {
+        return NULL;
+    }
+    MAKE_WORKER_PARAM(PROP_PREFIX_OF_WORKER);
+    return jk_map_get_string(m, buf, def);
+}
+
 int jk_get_is_read_only(jk_map_t *m, const char *wname)
 {
     int rc = JK_FALSE;
@@ -1065,21 +1081,65 @@
 
 int jk_get_worker_user_list(jk_map_t *m,
                             const char *wname,
-                            char ***list, unsigned int *num_of_users)
+                            char ***list, unsigned int *num)
 {
     char buf[1024];
 
-    if (m && list && num_of_users && wname) {
+    if (m && list && num && wname) {
         char **ar = NULL;
 
         MAKE_WORKER_PARAM(USER_OF_WORKER);
-        ar = jk_map_get_string_list(m, buf, num_of_users, NULL);
+        ar = jk_map_get_string_list(m, buf, num, NULL);
+        if (ar) {
+            *list = ar;
+            return JK_TRUE;
+        }
+        *list = NULL;
+        *num = 0;
+    }
+
+    return JK_FALSE;
+}
+
+int jk_get_worker_good_rating(jk_map_t *m,
+                              const char *wname,
+                              char ***list, unsigned int *num)
+{
+    char buf[1024];
+
+    if (m && list && num && wname) {
+        char **ar = NULL;
+
+        MAKE_WORKER_PARAM(GOOD_RATING_OF_WORKER);
+        ar = jk_map_get_string_list(m, buf, num, NULL);
+        if (ar) {
+            *list = ar;
+            return JK_TRUE;
+        }
+        *list = NULL;
+        *num = 0;
+    }
+
+    return JK_FALSE;
+}
+
+int jk_get_worker_bad_rating(jk_map_t *m,
+                             const char *wname,
+                             char ***list, unsigned int *num)
+{
+    char buf[1024];
+
+    if (m && list && num && wname) {
+        char **ar = NULL;
+
+        MAKE_WORKER_PARAM(BAD_RATING_OF_WORKER);
+        ar = jk_map_get_string_list(m, buf, num, NULL);
         if (ar) {
             *list = ar;
             return JK_TRUE;
         }
         *list = NULL;
-        *num_of_users = 0;
+        *num = 0;
     }
 
     return JK_FALSE;
@@ -1087,28 +1147,28 @@
 
 int jk_get_lb_worker_list(jk_map_t *m,
                           const char *wname,
-                          char ***list, unsigned int *num_of_wokers)
+                          char ***list, unsigned int *num_of_workers)
 {
     char buf[1024];
 
-    if (m && list && num_of_wokers && wname) {
+    if (m && list && num_of_workers && wname) {
         char **ar = NULL;
 
         MAKE_WORKER_PARAM(BALANCE_WORKERS);
-        ar = jk_map_get_string_list(m, buf, num_of_wokers, NULL);
+        ar = jk_map_get_string_list(m, buf, num_of_workers, NULL);
         if (ar) {
             *list = ar;
             return JK_TRUE;
         }
         /* Try old balanced_workers directive */
         MAKE_WORKER_PARAM(BALANCED_WORKERS_DEPRECATED);
-        ar = jk_map_get_string_list(m, buf, num_of_wokers, NULL);
+        ar = jk_map_get_string_list(m, buf, num_of_workers, NULL);
         if (ar) {
             *list = ar;
             return JK_TRUE;
         }
         *list = NULL;
-        *num_of_wokers = 0;
+        *num_of_workers = 0;
     }
 
     return JK_FALSE;

Modified: tomcat/connectors/trunk/jk/native/common/jk_util.h
URL: http://svn.apache.org/viewvc/tomcat/connectors/trunk/jk/native/common/jk_util.h?view=diff&rev=482060&r1=482059&r2=482060
==============================================================================
--- tomcat/connectors/trunk/jk/native/common/jk_util.h (original)
+++ tomcat/connectors/trunk/jk/native/common/jk_util.h Sun Dec  3 20:28:07 2006
@@ -98,7 +98,7 @@
 
 int jk_get_worker_activation(jk_map_t *m, const char *wname);
 
-int jk_get_worker_list(jk_map_t *m, char ***list, unsigned *num_of_wokers);
+int jk_get_worker_list(jk_map_t *m, char ***list, unsigned *num_of_workers);
 
 int jk_get_lb_factor(jk_map_t *m, const char *wname);
 
@@ -114,7 +114,7 @@
 
 int jk_get_lb_worker_list(jk_map_t *m,
                           const char *lb_wname,
-                          char ***list, unsigned int *num_of_wokers);
+                          char ***list, unsigned int *num_of_workers);
 int jk_get_worker_mount_list(jk_map_t *m,
                              const char *wname,
                              char ***list, unsigned int *num_of_maps);
@@ -175,13 +175,23 @@
 
 int jk_get_worker_user_list(jk_map_t *m,
                             const char *wname,
-                            char ***list, unsigned int *num_of_users);
+                            char ***list, unsigned int *num);
+
+int jk_get_worker_good_rating(jk_map_t *m,
+                              const char *wname,
+                              char ***list, unsigned int *num);
+
+int jk_get_worker_bad_rating(jk_map_t *m,
+                             const char *wname,
+                             char ***list, unsigned int *num);
 
 const char *jk_get_worker_name_space(jk_map_t *m, const char *wname, const char *def);
 
 const char *jk_get_worker_xmlns(jk_map_t *m, const char *wname, const char *def);
 
 const char *jk_get_worker_xml_doctype(jk_map_t *m, const char *wname, const char *def);
+
+const char *jk_get_worker_prop_prefix(jk_map_t *m, const char *wname, const char *def);
 
 #define TC32_BRIDGE_TYPE    32
 #define TC33_BRIDGE_TYPE    33



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


Mime
View raw message