glenn       2003/01/03 05:52:38

  Modified:    jk/xdocs/jk2 configwebcom.xml
               jk/native2/common jk_worker_lb.c
               jk/native2 CHANGES.txt
  Log:
  Port stickySession lb flag to jk2
  
  Revision  Changes    Path
  1.6       +7 -1      jakarta-tomcat-connectors/jk/xdocs/jk2/configwebcom.xml
  
  Index: configwebcom.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/xdocs/jk2/configwebcom.xml,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- configwebcom.xml  13 Nov 2002 00:22:12 -0000      1.5
  +++ configwebcom.xml  3 Jan 2003 13:52:38 -0000       1.6
  @@ -499,6 +499,12 @@
                               of the error state.
                               </td>
                           </tr>                        
  +                        <tr>
  +                            <td>stickySession</td>
  +                            <td>1 (true)</td>
  +                            <td>Sessions stick to the same worker, 1=true 0=false
  +                            </td>
  +                        </tr>
                       </table>
                   </p>
               </subsection>
  
  
  
  1.29      +10 -2     jakarta-tomcat-connectors/jk/native2/common/jk_worker_lb.c
  
  Index: jk_worker_lb.c
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/common/jk_worker_lb.c,v
  retrieving revision 1.28
  retrieving revision 1.29
  diff -u -r1.28 -r1.29
  --- jk_worker_lb.c    21 Nov 2002 09:03:17 -0000      1.28
  +++ jk_worker_lb.c    3 Jan 2003 13:52:38 -0000       1.29
  @@ -83,11 +83,14 @@
   
   #define NO_WORKER_MSG "The servlet container is temporary unavailable or being 
upgraded\n";
   
  +#define STICKY_SESSION 1
  +
   typedef struct {
       struct  jk_mutex *cs;
       int     attempts;
       int     recovery;
       int     timeout;
  +    int     sticky_session;  
       time_t  error_time;
   
   } jk_worker_lb_private_t;
  @@ -110,11 +113,13 @@
       int j;
       int level;
       int currentLevel=JK_LB_LEVELS - 1;
  -    char *session_route;
  +    char *session_route = NULL;
       time_t now = 0;
       jk_worker_lb_private_t *lb_priv = lb->worker_private;
   
  -    session_route = jk2_requtil_getSessionRoute(env, s);
  +    if(lb_priv->sticky_session) {
  +        session_route = jk2_requtil_getSessionRoute(env, s);
  +    }
          
       if(session_route) {
           for( level=0; level<JK_LB_LEVELS; level++ ) {
  @@ -504,6 +509,8 @@
           lb_priv->timeout=atoi( value );
       } else if( strcmp( name, "recovery") == 0 ) {
           lb_priv->recovery=atoi( value );
  +    } else if( strcmp( name, "stickySession") == 0 ) {
  +        lb_priv->sticky_session=atoi( value );
       } else if( strcmp( name, "attempts") == 0 ) {
           lb_priv->attempts=atoi( value );
       }
  @@ -580,6 +587,7 @@
       }
       worker_private->attempts = MAX_ATTEMPTS;
       worker_private->recovery = WAIT_BEFORE_RECOVER;
  +    worker_private->sticky_session = STICKY_SESSION;
       w->worker_private = worker_private;
       w->service        = jk2_lb_service;
       
  
  
  
  1.8       +6 -1      jakarta-tomcat-connectors/jk/native2/CHANGES.txt
  
  Index: CHANGES.txt
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/CHANGES.txt,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- CHANGES.txt       9 Dec 2002 13:27:20 -0000       1.7
  +++ CHANGES.txt       3 Jan 2003 13:52:38 -0000       1.8
  @@ -1,6 +1,11 @@
   JAKARTA TOMCAT CONNECTORS 2 (JK2) CHANGELOG:                 -*-text-*-
   Last modified at [$Date$]
   
  +Changes with JK2 2.0.4:
  +    * Added the load balancer stickySession property. If set to 0
  +      requests with servlet SESSION ID's can be routed to any Tomcat
  +      worker. Default is 1, sessions are sticky.
  +
   Changes with JK2 2.0.3:
       * jk2 set correctly the content-type in Apache 2.0,
         making it ready to works with mod_deflate and AddOutputFilterByType 
  
  
  

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

Reply via email to