Author: rjung
Date: Tue Oct 28 01:04:13 2008
New Revision: 708475

URL: http://svn.apache.org/viewvc?rev=708475&view=rev
Log:
Fix BZ 46104:
- Wrong Runtime state code to text mapping
  (Status worker displays wrong state)
and also:
- wrong text to state mapping (not used anywhere)
- make all state lists use the same order to
  prevent such errors in the future.

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

Modified: tomcat/connectors/trunk/jk/native/common/jk_lb_worker.c
URL: 
http://svn.apache.org/viewvc/tomcat/connectors/trunk/jk/native/common/jk_lb_worker.c?rev=708475&r1=708474&r2=708475&view=diff
==============================================================================
--- tomcat/connectors/trunk/jk/native/common/jk_lb_worker.c (original)
+++ tomcat/connectors/trunk/jk/native/common/jk_lb_worker.c Tue Oct 28 01:04:13 
2008
@@ -73,9 +73,9 @@
     JK_LB_STATE_TEXT_IDLE,
     JK_LB_STATE_TEXT_OK,
     JK_LB_STATE_TEXT_RECOVER,
+    JK_LB_STATE_TEXT_FORCE,
     JK_LB_STATE_TEXT_BUSY,
     JK_LB_STATE_TEXT_ERROR,
-    JK_LB_STATE_TEXT_FORCE,
     JK_LB_STATE_TEXT_PROBE,
     "unknown",
     NULL
@@ -206,12 +206,12 @@
         return JK_LB_STATE_OK;
     else if  (*v == 'r' || *v == 'R' || *v == '2')
         return JK_LB_STATE_RECOVER;
-    else if  (*v == 'b' || *v == 'B' || *v == '3')
+    else if  (*v == 'f' || *v == 'F' || *v == '3')
+        return JK_LB_STATE_FORCE;
+    else if  (*v == 'b' || *v == 'B' || *v == '4')
         return JK_LB_STATE_BUSY;
-    else if  (*v == 'e' || *v == 'E' || *v == '4')
+    else if  (*v == 'e' || *v == 'E' || *v == '5')
         return JK_LB_STATE_ERROR;
-    else if  (*v == 'f' || *v == 'F' || *v == '5')
-        return JK_LB_STATE_FORCE;
     else if  (*v == 'p' || *v == 'P' || *v == '6')
         return JK_LB_STATE_PROBE;
     else

Modified: tomcat/connectors/trunk/jk/native/common/jk_lb_worker.h
URL: 
http://svn.apache.org/viewvc/tomcat/connectors/trunk/jk/native/common/jk_lb_worker.h?rev=708475&r1=708474&r2=708475&view=diff
==============================================================================
--- tomcat/connectors/trunk/jk/native/common/jk_lb_worker.h (original)
+++ tomcat/connectors/trunk/jk/native/common/jk_lb_worker.h Tue Oct 28 01:04:13 
2008
@@ -76,8 +76,8 @@
 #define JK_LB_STATE_TEXT_IDLE          ("OK/IDLE")
 #define JK_LB_STATE_TEXT_OK            ("OK")
 #define JK_LB_STATE_TEXT_RECOVER       ("ERR/REC")
-#define JK_LB_STATE_TEXT_BUSY          ("OK/BUSY")
 #define JK_LB_STATE_TEXT_FORCE         ("ERR/FRC")
+#define JK_LB_STATE_TEXT_BUSY          ("OK/BUSY")
 #define JK_LB_STATE_TEXT_ERROR         ("ERR")
 #define JK_LB_STATE_TEXT_PROBE         ("ERR/PRB")
 #define JK_LB_STATE_TEXT_MAX           (JK_LB_STATE_PROBE)

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=708475&r1=708474&r2=708475&view=diff
==============================================================================
--- tomcat/connectors/trunk/jk/native/common/jk_status.c (original)
+++ tomcat/connectors/trunk/jk/native/common/jk_status.c Tue Oct 28 01:04:13 
2008
@@ -719,17 +719,11 @@
     }
     switch (state)
     {
-    case JK_LB_STATE_OK:
-        mask &= JK_STATUS_MASK_OK;
-        break;
     case JK_LB_STATE_IDLE:
         mask &= JK_STATUS_MASK_IDLE;
         break;
-    case JK_LB_STATE_BUSY:
-        mask &= JK_STATUS_MASK_BUSY;
-        break;
-    case JK_LB_STATE_ERROR:
-        mask &= JK_STATUS_MASK_ERROR;
+    case JK_LB_STATE_OK:
+        mask &= JK_STATUS_MASK_OK;
         break;
     case JK_LB_STATE_RECOVER:
         mask &= JK_STATUS_MASK_RECOVER;
@@ -737,6 +731,12 @@
     case JK_LB_STATE_FORCE:
         mask &= JK_STATUS_MASK_RECOVER;
         break;
+    case JK_LB_STATE_BUSY:
+        mask &= JK_STATUS_MASK_BUSY;
+        break;
+    case JK_LB_STATE_ERROR:
+        mask &= JK_STATUS_MASK_ERROR;
+        break;
     case JK_LB_STATE_PROBE:
         mask &= JK_STATUS_MASK_RECOVER;
         break;



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

Reply via email to