tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rj...@apache.org
Subject svn commit: r753213 - /tomcat/connectors/trunk/jk/native/common/jk_lb_worker.c
Date Fri, 13 Mar 2009 11:45:45 GMT
Author: rjung
Date: Fri Mar 13 11:45:44 2009
New Revision: 753213

URL: http://svn.apache.org/viewvc?rev=753213&view=rev
Log:
Switch back to const char* arguments and
rename arguments in a more precise way.

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=753213&r1=753212&r2=753213&view=diff
==============================================================================
--- tomcat/connectors/trunk/jk/native/common/jk_lb_worker.c (original)
+++ tomcat/connectors/trunk/jk/native/common/jk_lb_worker.c Fri Mar 13 11:45:44 2009
@@ -689,7 +689,7 @@
 
 static int find_by_session(jk_ws_service_t *s,
                            lb_worker_t *p,
-                           char *sessionid,
+                           const char *session_route,
                            jk_logger_t *l)
 {
 
@@ -697,7 +697,7 @@
     unsigned int i;
 
     for (i = 0; i < p->num_of_workers; i++) {
-        if (strcmp(p->lb_workers[i].route, sessionid) == 0) {
+        if (strcmp(p->lb_workers[i].route, session_route) == 0) {
             rc = i;
             break;
         }
@@ -707,7 +707,7 @@
 
 static int find_best_bydomain(jk_ws_service_t *s,
                               lb_worker_t *p,
-                              char *sessionid,
+                              const char *route_or_domain,
                               int *states,
                               jk_logger_t *l)
 {
@@ -717,14 +717,14 @@
     int candidate = -1;
     int activation;
     lb_sub_worker_t wr;
-    char *idpart = strchr(sessionid, '.');
+    char *idpart = strchr(route_or_domain, '.');
     size_t domain_len = 0;
 
     if (idpart) {
-        domain_len = idpart - sessionid;
+        domain_len = idpart - route_or_domain;
     }
     else {
-        domain_len = strlen(sessionid);
+        domain_len = strlen(route_or_domain);
     }
     /* First try to see if we have available candidate */
     for (i = 0; i < p->num_of_workers; i++) {
@@ -732,7 +732,7 @@
         wr = p->lb_workers[i];
         if (strlen(wr.domain) == 0 ||
             strlen(wr.domain) != domain_len ||
-            strncmp(wr.domain, sessionid, domain_len))
+            strncmp(wr.domain, route_or_domain, domain_len))
             continue;
         /* Take into calculation only the workers that are
          * not in error state, stopped, disabled or busy.
@@ -803,17 +803,17 @@
 
 static int find_bysession_route(jk_ws_service_t *s,
                                 lb_worker_t *p,
-                                char *sessionid,
+                                const char *session_route,
                                 int *states,
                                 jk_logger_t *l)
 {
     int uses_domain  = 0;
     int candidate = -1;
 
-    candidate = find_by_session(s, p, sessionid, l);
+    candidate = find_by_session(s, p, session_route, l);
     if (candidate < 0) {
         uses_domain = 1;
-        candidate = find_best_bydomain(s, p, sessionid, states, l);
+        candidate = find_best_bydomain(s, p, session_route, states, l);
     }
     if (candidate >= 0) {
         lb_sub_worker_t wr = p->lb_workers[candidate];



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


Mime
View raw message