tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mt...@apache.org
Subject cvs commit: jakarta-tomcat-connectors/jk/native2/common jk_worker_ajp13.c
Date Fri, 18 Oct 2002 15:23:52 GMT
mturk       2002/10/18 08:23:52

  Modified:    jk/native2/common jk_worker_ajp13.c
  Log:
  Add max_connections option that checks the number of used endpoints.
  If the specified number is reached then the load balancer has the chance
  to try another worker. This is very usefull in situations when having multiple
  servers and you wish to finer grade the lb_factor.
  Perhaps the option param can have another name?
  
  Revision  Changes    Path
  1.41      +17 -0     jakarta-tomcat-connectors/jk/native2/common/jk_worker_ajp13.c
  
  Index: jk_worker_ajp13.c
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/common/jk_worker_ajp13.c,v
  retrieving revision 1.40
  retrieving revision 1.41
  diff -u -r1.40 -r1.41
  --- jk_worker_ajp13.c	15 Oct 2002 09:38:29 -0000	1.40
  +++ jk_worker_ajp13.c	18 Oct 2002 15:23:52 -0000	1.41
  @@ -160,6 +160,8 @@
           ajp13->level=atoi( value );
       } else if( strcmp( name, "channel" )==0 ) {
           ajp13->channelName=value;
  +    } else if( strcmp( name, "max_connections" )==0 ) {
  +        ajp13->maxEndpoints=atoi(value);
       } else {
           return JK_ERR;
       }
  @@ -585,6 +587,21 @@
           ajp13->cs->lock( env, ajp13->cs );
   
       {
  +        if (ajp13->maxEndpoints && 
  +            ajp13->maxEndpoints <= ajp13->endpointMap->size(env, ajp13->endpointMap))
{
  +            /* The maximum number of connections is reached */
  +            ajp13->in_max_epcount = JK_TRUE;
  +            if( ajp13->cs != NULL ) 
  +                ajp13->cs->unLock( env, ajp13->cs );
  +            if( ajp13->mbean->debug > 0 )
  +                env->l->jkLog(env, env->l, JK_LOG_DEBUG,
  +                              "ajp13.getEndpoint(): maximum %d endpoints for %s reached\n",
  +                              ajp13->maxEndpoints, 
  +                              ajp13->mbean->name);
  +            return JK_ERR;
  +        }
  +        ajp13->in_max_epcount = JK_FALSE;
  +
           jkb=env->createBean2( env, ajp13->mbean->pool,  "endpoint", NULL );
           if( jkb==NULL ) {
               if( ajp13->cs != NULL ) 
  
  
  

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


Mime
View raw message