You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by mt...@apache.org on 2003/04/15 19:49:50 UTC

cvs commit: jakarta-tomcat-connectors/jk/native2/common jk_uriEnv.c

mturk       2003/04/15 10:49:50

  Modified:    jk/native2/common jk_uriEnv.c
  Log:
  1. Fix the getAttributeInfo for aliases.
  2. Add pretty printing of match_types.
  
  Revision  Changes    Path
  1.47      +17 -5     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.46
  retrieving revision 1.47
  diff -u -r1.46 -r1.47
  --- jk_uriEnv.c	15 Mar 2003 12:34:39 -0000	1.46
  +++ jk_uriEnv.c	15 Apr 2003 17:49:49 -0000	1.47
  @@ -184,18 +184,30 @@
       return JK_OK;
   }
   
  -static char *getAttInfo[]={ "host", "uri", "group", "context", "inheritGlobals", "match_type", "prefix", "suffix",
  +static char *getAttInfo[]={ "host", "uri", "group", "context", "inheritGlobals", 
  +                            "match_type",
                               "servlet", "timing", "aliases", "path", NULL };
   static char *setAttInfo[]={ "host", "uri", "group", "context", "inheritGlobals",
                               "servlet", "timing", "alias", "path", NULL };
       
  +static char *matchTypes[] = { 
  +    "exact",
  +    "prefix",
  +    "suffix",
  +    "gensuffix",
  +    "contextpath",
  +    "host",
  +    "context",
  +    "regexp"
  +};
  + 
   static void * JK_METHOD jk2_uriEnv_getAttribute(jk_env_t *env, jk_bean_t *bean,
                                        char *name )
   {
       jk_uriEnv_t *uriEnv=(jk_uriEnv_t *)bean->object;
       
       if( strcmp( name, "host" )==0 ) {
  -        return  (uriEnv->virtual==NULL) ? "*" : uriEnv->virtual;
  +        return  uriEnv->virtual;
       } else if( strcmp( name, "uri" )==0 ) {
           return uriEnv->uri;
       } else if( strcmp( name, "group" )==0 ) {
  @@ -209,10 +221,10 @@
       } else if( strcmp( name, "suffix" )==0 ) {
           return uriEnv->suffix;
       } else if( strcmp( name, "match_type" )==0 ) {
  -        return jk2_env_itoa(env, uriEnv->match_type);
  +        return matchTypes[uriEnv->match_type];
       } else if (strcmp("timing", name) == 0) {
           return jk2_env_itoa(env, uriEnv->timing);
  -    } else if (strcmp("aliases", name) == 0) {
  +    } else if (strcmp("aliases", name) == 0 && uriEnv->aliases) {
           return jk2_map_concatKeys( env, uriEnv->aliases, ":" );
       } else if (strcmp("path", name) == 0) {
           return uriEnv->uri;
  @@ -533,7 +545,7 @@
       uriEnv->mbean = result;
       result->object = uriEnv;
       result->getAttributeInfo = getAttInfo;
  -    result->getAttributeInfo = setAttInfo;
  +    result->setAttributeInfo = setAttInfo;
   
       uriEnv->name = result->localName;
       if (jk2_uriEnv_parseName(env, uriEnv, result->localName) != JK_OK) {
  
  
  

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