You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by rj...@apache.org on 2006/11/22 19:10:21 UTC
svn commit: r478268 - in /tomcat/connectors/trunk/jk/native/common:
jk_status.c jk_uri_worker_map.c jk_uri_worker_map.h
Author: rjung
Date: Wed Nov 22 10:10:20 2006
New Revision: 478268
URL: http://svn.apache.org/viewvc?view=rev&rev=478268
Log:
- Add unsigned int -> text function for match type.
- Use this function in status worker.
The previous one didn't correctly handle the possible
combinations of bits in the match type.
- Add the display of mapping rules to normal non-lb
workers and to the global vie.
- Drop the column context in the listing of the mapping
rules, because since some time context is equal to uri.
- Add column source type.
Modified:
tomcat/connectors/trunk/jk/native/common/jk_status.c
tomcat/connectors/trunk/jk/native/common/jk_uri_worker_map.c
tomcat/connectors/trunk/jk/native/common/jk_uri_worker_map.h
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?view=diff&rev=478268&r1=478267&r2=478268
==============================================================================
--- tomcat/connectors/trunk/jk/native/common/jk_status.c (original)
+++ tomcat/connectors/trunk/jk/native/common/jk_status.c Wed Nov 22 10:10:20 2006
@@ -218,32 +218,6 @@
return "True";
}
-static const char *status_val_match(unsigned int match)
-{
- if (match & MATCH_TYPE_DISABLED)
- return "Disabled";
- else if (match & MATCH_TYPE_NO_MATCH)
- return "Unmount";
- else if (match & MATCH_TYPE_EXACT)
- return "Exact";
- else if (match & MATCH_TYPE_WILDCHAR_PATH)
- return "Wildchar";
-/* deprecated
- else if (match & MATCH_TYPE_STOPPED)
- return "Stopped";
- else if (match & MATCH_TYPE_CONTEXT)
- return "Context";
- else if (match & MATCH_TYPE_CONTEXT_PATH)
- return "Context Path";
- else if (match & MATCH_TYPE_SUFFIX)
- return "Suffix";
- else if (match & MATCH_TYPE_GENERAL_SUFFIX)
- return "General Suffix";
- */
- else
- return "Error";
-}
-
static void jk_puts(jk_ws_service_t *s, const char *str)
{
if (str)
@@ -336,23 +310,24 @@
jk_uri_worker_map_t *uwmap,
const char *worker, jk_logger_t *l)
{
+ char buf[64];
unsigned int i;
jk_puts(s, "<br/>Uri Mappings:\n");
jk_puts(s, "<table>\n<tr><th>Match Type</th><th>Uri</th>"
- "<th>Context</th></tr>\n");
+ "<th>Source</th></tr>\n");
for (i = 0; i < uwmap->size; i++) {
uri_worker_record_t *uwr = uwmap->maps[i];
- if (strcmp(uwr->worker_name, worker)) {
+ if (worker && strcmp(uwr->worker_name, worker)) {
continue;
}
jk_putv(s, "<tr><td>",
- status_val_match(uwr->match_type),
+ uri_worker_map_get_match(uwr, buf, l),
"</td><td>", NULL);
jk_puts(s, uwr->uri);
- jk_putv(s, "</td><td>", uwr->context, NULL);
-
- jk_puts(s, "</td></tr>\n");
+ jk_putv(s, "</td><td>",
+ uri_worker_map_get_source(uwr, l),
+ "</td></tr>\n", NULL);
}
jk_puts(s, "</table>\n");
}
@@ -361,17 +336,18 @@
jk_uri_worker_map_t *uwmap,
const char *worker, jk_logger_t *l)
{
+ char buf[64];
unsigned int i;
for (i = 0; i < uwmap->size; i++) {
uri_worker_record_t *uwr = uwmap->maps[i];
- if (strcmp(uwr->worker_name, worker)) {
+ if (worker && strcmp(uwr->worker_name, worker)) {
continue;
}
- jk_printf(s, " <jk:map type=\"%s\" uri=\"%s\" context=\"%s\" />\n",
- status_val_match(uwr->match_type),
- uwr->uri,
- uwr->context) ;
+ jk_printf(s, " <jk:map type=\"%s\" uri=\"%s\" source=\"%s\" />\n",
+ uri_worker_map_get_match(uwr, buf, l),
+ uwr->uri,
+ uri_worker_map_get_source(uwr, l));
}
}
@@ -589,7 +565,6 @@
"</td>\n</tr>\n", NULL);
jk_puts(s, "</table>\n");
display_maps(s, sw, s->uw_map, dworker, l);
-
}
}
/* Display legend */
Modified: tomcat/connectors/trunk/jk/native/common/jk_uri_worker_map.c
URL: http://svn.apache.org/viewvc/tomcat/connectors/trunk/jk/native/common/jk_uri_worker_map.c?view=diff&rev=478268&r1=478267&r2=478268
==============================================================================
--- tomcat/connectors/trunk/jk/native/common/jk_uri_worker_map.c (original)
+++ tomcat/connectors/trunk/jk/native/common/jk_uri_worker_map.c Wed Nov 22 10:10:20 2006
@@ -48,10 +48,45 @@
};
-/* Return the string representation of the balance worker state */
+/* Return the string representation of the uwr source */
const char *uri_worker_map_get_source(uri_worker_record_t *uwr, jk_logger_t *l)
{
return uri_worker_map_source_type[uwr->source_type];
+}
+
+/* Return the string representation of the uwr match type */
+char *uri_worker_map_get_match(uri_worker_record_t *uwr, char *buf, jk_logger_t *l)
+{
+ unsigned int match;
+
+ buf[0] = '\0';
+ match = uwr->match_type;
+
+ if (match & MATCH_TYPE_DISABLED)
+ strcat(buf, "Disabled ");
+/* deprecated
+ if (match & MATCH_TYPE_STOPPED)
+ strcat(buf, "Stopped ");
+ */
+ if (match & MATCH_TYPE_NO_MATCH)
+ strcat(buf, "Unmount ");
+ if (match & MATCH_TYPE_EXACT)
+ strcat(buf, "Exact");
+ else if (match & MATCH_TYPE_WILDCHAR_PATH)
+ strcat(buf, "Wildchar");
+/* deprecated
+ else if (match & MATCH_TYPE_CONTEXT)
+ strcat(buf, "Context");
+ else if (match & MATCH_TYPE_CONTEXT_PATH)
+ strcat(buf, "Context Path");
+ else if (match & MATCH_TYPE_SUFFIX)
+ strcat(buf, "Suffix");
+ else if (match & MATCH_TYPE_GENERAL_SUFFIX)
+ return "General Suffix";
+ */
+ else
+ strcat(buf, "Unknown");
+ return buf;
}
/*
Modified: tomcat/connectors/trunk/jk/native/common/jk_uri_worker_map.h
URL: http://svn.apache.org/viewvc/tomcat/connectors/trunk/jk/native/common/jk_uri_worker_map.h?view=diff&rev=478268&r1=478267&r2=478268
==============================================================================
--- tomcat/connectors/trunk/jk/native/common/jk_uri_worker_map.h (original)
+++ tomcat/connectors/trunk/jk/native/common/jk_uri_worker_map.h Wed Nov 22 10:10:20 2006
@@ -126,6 +126,8 @@
const char *uri_worker_map_get_source(uri_worker_record_t *uwr, jk_logger_t *l);
+char *uri_worker_map_get_match(uri_worker_record_t *uwr, char *buf, jk_logger_t *l);
+
int uri_worker_map_alloc(jk_uri_worker_map_t **uw_map,
jk_map_t *init_data, jk_logger_t *l);
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org