costin      2002/09/23 15:15:04

  Modified:    jk/native2/common jk_uriEnv.c
  Log:
  Revert  ( actually  use ifdefs ) the change, so it compiles again in 1.3.
  
  Revision  Changes    Path
  1.28      +41 -0     jakarta-tomcat-connectors/jk/native2/common/jk_uriEnv.c
  
  Index: jk_uriEnv.c
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/common/jk_uriEnv.c,v
  retrieving revision 1.27
  retrieving revision 1.28
  diff -u -r1.27 -r1.28
  --- jk_uriEnv.c       23 Sep 2002 17:39:24 -0000      1.27
  +++ jk_uriEnv.c       23 Sep 2002 22:15:04 -0000      1.28
  @@ -69,7 +69,9 @@
   #include "jk_uriMap.h"
   #include "jk_registry.h"
   
  +#ifdef HAS_APR
   #include "apr_uri.h"
  +
   /** Parse the name:
          VHOST/PATH
   
  @@ -117,6 +119,45 @@
       }
       return JK_ERR;
   }
  +
  +#else
  +/* Old version, deprecated - used only if APR is not available
  + */
  +static int jk2_uriEnv_parseName( jk_env_t *env, jk_uriEnv_t *uriEnv,
  +                                 char *name)
  +{
  +    char *n=name;
  +    char *slash=strchr( name, '/' );
  +    
  +    /* fprintf( stderr, "XXX parseURI %s\n", name ); */
  +    
  +    if( slash==NULL ) {
  +        /* That's a virtual host definition ( no actual mapping, just global
  +         * settings like aliases, etc
  +         */
  +        uriEnv->match_type= MATCH_TYPE_HOST;
  +        if( name[0]=='\0' ) {
  +            uriEnv->virtual=NULL; /* "" for the default host */
  +        } else {
  +            uriEnv->virtual=name;
  +        }
  +        return JK_OK;
  +    }
  +    
  +    /* If it doesn't start with /, it must have a vhost */
  +    if( *name != '/' ) {
  +        uriEnv->virtual=uriEnv->pool->calloc( env, uriEnv->pool, slash - name + 2 );
  +        strncpy( uriEnv->virtual, name, slash-name );
  +    }
  +    
  +    n=slash;
  +    
  +    uriEnv->uri=uriEnv->pool->pstrdup(env, uriEnv->pool, n);
  +
  +    return JK_OK;
  +}
  +
  +#endif
   
   static void * JK_METHOD jk2_uriEnv_getAttribute(jk_env_t *env, jk_bean_t *bean,
                                        char *name )
  
  
  

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

Reply via email to