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 2007/12/11 22:27:36 UTC

svn commit: r603368 - /tomcat/connectors/trunk/jk/native/common/jk_lb_worker.c

Author: rjung
Date: Tue Dec 11 13:27:36 2007
New Revision: 603368

URL: http://svn.apache.org/viewvc?rev=603368&view=rev
Log:
Use JK_UNSET instead of magical -1.

Modified:
    tomcat/connectors/trunk/jk/native/common/jk_lb_worker.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=603368&r1=603367&r2=603368&view=diff
==============================================================================
--- tomcat/connectors/trunk/jk/native/common/jk_lb_worker.c (original)
+++ tomcat/connectors/trunk/jk/native/common/jk_lb_worker.c Tue Dec 11 13:27:36 2007
@@ -886,7 +886,7 @@
     int num_of_workers;
     int first = 1;
     int was_forced = 0;
-    int rc = -1;
+    int rc = JK_UNSET;
     char *sessionid = NULL;
 
     JK_TRACE_ENTER(l);
@@ -940,7 +940,7 @@
                "service sticky_session=%d id='%s'",
                p->worker->sticky_session, sessionid ? sessionid : "empty");
 
-    while (attempt <= num_of_workers && rc == -1) {
+    while (attempt <= num_of_workers && rc == JK_UNSET) {
         worker_record_t *rec =
             get_most_suitable_worker(p->worker, sessionid, s, l);
         /* Do not reuse previous worker, because
@@ -1002,7 +1002,7 @@
                        rec->s->name, retry);
             }
             else {
-                int service_stat = -1;
+                int service_stat = JK_UNSET;
                 jk_uint64_t rd = 0;
                 jk_uint64_t wr = 0;
                 /* Reset endpoint read and write sizes for
@@ -1133,7 +1133,7 @@
                 if (p->worker->lblock == JK_LB_LOCK_PESSIMISTIC)
                     jk_shm_unlock();
             }
-            if ( rc == -1 ) {
+            if ( rc == JK_UNSET ) {
                 /*
                  * Error is recoverable by submitting the request to
                  * another worker... Lets try to do that.
@@ -1163,7 +1163,7 @@
                      * Reset the service loop and go again
                      */
                     prec = NULL;
-                    rc   = -1;
+                    rc   = JK_UNSET;
                     jk_log(l, JK_LOG_INFO,
                            "Forcing recovery once for %d workers", nf);
                     continue;
@@ -1187,7 +1187,7 @@
         }
         attempt++;
     }
-    if ( rc == -1 ) {
+    if ( rc == JK_UNSET ) {
         jk_log(l, JK_LOG_INFO,
                "All tomcat instances are busy or in error state");
         /* Set error to Timeout */



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