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/native/common jk_uri_worker_map.c
Date Fri, 08 Oct 2004 07:19:34 GMT
mturk       2004/10/08 00:19:34

  Modified:    jk/native/common jk_uri_worker_map.c
  Log:
  Untabify the source.
  
  Revision  Changes    Path
  1.22      +58 -59    jakarta-tomcat-connectors/jk/native/common/jk_uri_worker_map.c
  
  Index: jk_uri_worker_map.c
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native/common/jk_uri_worker_map.c,v
  retrieving revision 1.21
  retrieving revision 1.22
  diff -u -r1.21 -r1.22
  --- jk_uri_worker_map.c	24 Feb 2004 08:45:46 -0000	1.21
  +++ jk_uri_worker_map.c	8 Oct 2004 07:19:34 -0000	1.22
  @@ -90,8 +90,7 @@
    * ".suffix/", or ".suffix ".
    */
   static int check_security_fraud(jk_uri_worker_map_t *uw_map, 
  -                                const char *uri, 
  -                                jk_logger_t *l)
  +                                const char *uri)
   {
       unsigned i;    
   
  @@ -153,10 +152,10 @@
           uri_worker_map_close(*uw_map, l);  
           free(*uw_map);
           *uw_map = NULL;
  -	return JK_TRUE;
  +    return JK_TRUE;
       }
       else 
  -    	jk_log(l, JK_LOG_ERROR, 
  +        jk_log(l, JK_LOG_ERROR, 
              "In jk_uri_worker_map_t::uri_worker_map_free, NULL parameters\n");    
   
       return JK_FALSE;
  @@ -257,30 +256,30 @@
                       uwr->match_type  = MATCH_TYPE_SUFFIX;
                       jk_log(l, JK_LOG_DEBUG,
                              "Into jk_uri_worker_map_t::uri_worker_map_open, "
  -			   "suffix rule %s.%s=%s was added\n",
  +               "suffix rule %s.%s=%s was added\n",
                               uri, asterisk + 3, worker); 
  -		} else if ('\0' != asterisk[2]) {
  -		    /* general suffix rule */
  -		    asterisk[1] = '\0';
  -		    uwr->worker_name = worker;
  -		    uwr->context = uri;
  -		    uwr->suffix  = asterisk + 2;
  -		    uwr->match_type = MATCH_TYPE_GENERAL_SUFFIX;
  -		    jk_log(l, JK_LOG_DEBUG,
  -			   "Into jk_uri_worker_map_t::uri_worker_map_open, "
  -			   "general suffix rule %s*%s=%s was added\n",
  -			   uri, asterisk + 2, worker);
  -		} else {
  -		    /* context based */
  -		    asterisk[1]      = '\0';
  -		    uwr->worker_name = worker;
  -		    uwr->context     = uri;
  -		    uwr->suffix      = NULL;
  -		    uwr->match_type  = MATCH_TYPE_CONTEXT;
  -		    jk_log(l, JK_LOG_DEBUG,
  -			   "Into jk_uri_worker_map_t::uri_worker_map_open, "
  -			   "match rule %s=%s was added\n",
  -			   uri, worker);
  +        } else if ('\0' != asterisk[2]) {
  +            /* general suffix rule */
  +            asterisk[1] = '\0';
  +            uwr->worker_name = worker;
  +            uwr->context = uri;
  +            uwr->suffix  = asterisk + 2;
  +            uwr->match_type = MATCH_TYPE_GENERAL_SUFFIX;
  +            jk_log(l, JK_LOG_DEBUG,
  +               "Into jk_uri_worker_map_t::uri_worker_map_open, "
  +               "general suffix rule %s*%s=%s was added\n",
  +               uri, asterisk + 2, worker);
  +        } else {
  +            /* context based */
  +            asterisk[1]      = '\0';
  +            uwr->worker_name = worker;
  +            uwr->context     = uri;
  +            uwr->suffix      = NULL;
  +            uwr->match_type  = MATCH_TYPE_CONTEXT;
  +            jk_log(l, JK_LOG_DEBUG,
  +               "Into jk_uri_worker_map_t::uri_worker_map_open, "
  +               "match rule %s=%s was added\n",
  +               uri, worker);
                   }
               } else {
                   /* Something like : JkMount /servlets/exampl* ajp13 */
  @@ -389,7 +388,7 @@
       const char *str_minus_one=str-1;
       const char *s=str+strlen(str);
       while(s!=str_minus_one && ch!=*s) {
  -	--s;
  +    --s;
       }
       return (s-str);
   }
  @@ -403,7 +402,7 @@
       if(uw_map) {
           jk_close_pool(&uw_map->p);
           jk_close_pool(&uw_map->tp);
  -	return JK_TRUE;
  +    return JK_TRUE;
       }
   
       jk_log(l, JK_LOG_ERROR, 
  @@ -469,38 +468,38 @@
                               uwr->ctxt_len)) {
                   if(MATCH_TYPE_EXACT == uwr->match_type) {
                       if(strlen(uri) == uwr->ctxt_len) {
  -			jk_log(l,
  -			       JK_LOG_DEBUG,
  -			       "jk_uri_worker_map_t::map_uri_to_worker, "
  -			       "Found an exact match %s -> %s\n",
  -			       uwr->worker_name,
  -			       uwr->context );
  +            jk_log(l,
  +                   JK_LOG_DEBUG,
  +                   "jk_uri_worker_map_t::map_uri_to_worker, "
  +                   "Found an exact match %s -> %s\n",
  +                   uwr->worker_name,
  +                   uwr->context );
                           return uwr->worker_name;
                       }
                   } else if(MATCH_TYPE_CONTEXT == uwr->match_type) {
                       if(uwr->ctxt_len > longest_match) {
  -			jk_log(l,
  -			       JK_LOG_DEBUG,
  -			       "jk_uri_worker_map_t::map_uri_to_worker, "
  -			       "Found a context match %s -> %s\n",
  -			       uwr->worker_name,
  -			       uwr->context );
  +            jk_log(l,
  +                   JK_LOG_DEBUG,
  +                   "jk_uri_worker_map_t::map_uri_to_worker, "
  +                   "Found a context match %s -> %s\n",
  +                   uwr->worker_name,
  +                   uwr->context );
                           longest_match = uwr->ctxt_len;
                           best_match = i;
                       }
  -		} else if(MATCH_TYPE_GENERAL_SUFFIX == uwr->match_type) {
  +        } else if(MATCH_TYPE_GENERAL_SUFFIX == uwr->match_type) {
                       int suffix_start=last_index_of(uri,uwr->suffix[0]);
                       if (suffix_start>=0 && 0==strcmp(uri+suffix_start,uwr->suffix))
{
  -			if(uwr->ctxt_len >= longest_match) {
  -			    jk_log(l,
  -				   JK_LOG_DEBUG,
  -				   "jk_uri_worker_map_t::map_uri_to_worker, "
  -				   "Found a general suffix match %s -> *%s\n",
  -				   uwr->worker_name,
  -				   uwr->suffix );
  -			    longest_match = uwr->ctxt_len;
  -			    best_match = i;
  -			}
  +            if(uwr->ctxt_len >= longest_match) {
  +                jk_log(l,
  +                   JK_LOG_DEBUG,
  +                   "jk_uri_worker_map_t::map_uri_to_worker, "
  +                   "Found a general suffix match %s -> *%s\n",
  +                   uwr->worker_name,
  +                   uwr->suffix );
  +                longest_match = uwr->ctxt_len;
  +                best_match = i;
  +            }
                       }
                   } else if(MATCH_TYPE_CONTEXT_PATH == uwr->match_type) {
                       char *suffix_path = NULL;
  @@ -535,11 +534,11 @@
                           if(0 == strcmp(suffix, uwr->suffix)) {
   #endif
                               if(uwr->ctxt_len >= longest_match) {
  -				jk_log(l,
  -				       JK_LOG_DEBUG,
  -				       "jk_uri_worker_map_t::map_uri_to_worker, Found a suffix match %s -> *.%s\n",
  -				       uwr->worker_name,
  -				       uwr->suffix );
  +                jk_log(l,
  +                       JK_LOG_DEBUG,
  +                       "jk_uri_worker_map_t::map_uri_to_worker, Found a suffix match %s
-> *.%s\n",
  +                       uwr->worker_name,
  +                       uwr->suffix );
                                   longest_match = uwr->ctxt_len;
                                   best_match = i;
                               }
  @@ -560,7 +559,7 @@
                * To solve that we will check for path info following the suffix, we 
                * will also check that the end of the uri is not .suffix.
                */
  -            int fraud = check_security_fraud(uw_map, uri, l);
  +            int fraud = check_security_fraud(uw_map, uri);
   
               if(fraud >= 0) {
                   jk_log(l, JK_LOG_EMERG, 
  
  
  

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


Mime
View raw message