You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by rb...@locus.apache.org on 2000/03/28 20:36:35 UTC

cvs commit: apache-2.0/src/main http_config.c

rbb         00/03/28 10:36:35

  Modified:    src/main http_config.c
  Log:
  Remove the last piece of the layered I/O code.  I don't know why this didn't
  get removed with the rest of it.
  
  Revision  Changes    Path
  1.31      +36 -43    apache-2.0/src/main/http_config.c
  
  Index: http_config.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/main/http_config.c,v
  retrieving revision 1.30
  retrieving revision 1.31
  diff -u -r1.30 -r1.31
  --- http_config.c	2000/03/25 15:00:09	1.30
  +++ http_config.c	2000/03/28 18:36:34	1.31
  @@ -308,60 +308,53 @@
       const char *handler;
       char *p;
       size_t handler_len;
  -    int result;
  +    int result = HTTP_INTERNAL_SERVER_ERROR;
   
  -    do {
  -        result = DECLINED;
  -        if (r->handler) {
  -    	    handler = r->handler;
  +    if (r->handler) {
  +        handler = r->handler;
  +        handler_len = strlen(handler);
  +    }
  +    else {
  +        handler = r->content_type ? r->content_type : ap_default_type(r);
  +        if ((p = strchr(handler, ';')) != NULL) { /* MIME type arguments */
  +            while (p > handler && p[-1] == ' ')
  +	        --p;		/* strip trailing spaces */
  +	    handler_len = p - handler;
  +	}
  +	else {
   	    handler_len = strlen(handler);
  -        }
  -        else {
  -	    handler = r->content_type ? r->content_type : ap_default_type(r);
  -	    if ((p = strchr(handler, ';')) != NULL) { /* MIME type arguments */
  -    	        while (p > handler && p[-1] == ' ')
  -		    --p;		/* strip trailing spaces */
  -	        handler_len = p - handler;
  -	    }
  -	    else {
  -	        handler_len = strlen(handler);
  -	    }
  -        }
  +	}
  +    }
   
  -        /* Pass one --- direct matches */
  - 
  -        for (handp = handlers; handp->hr.content_type; ++handp) {
  -    	    if (handler_len == handp->len
  -	        && !strncmp(handler, handp->hr.content_type, handler_len)) {
  -                result = (*handp->hr.handler) (r);
  -
  -                if (result != DECLINED)
  -                    break;
  -            }
  -        }
  +    /* Pass one --- direct matches */
   
  -        /* Pass two --- wildcard matches */
  +    for (handp = handlers; handp->hr.content_type; ++handp) {
  +        if (handler_len == handp->len
  +            && !strncmp(handler, handp->hr.content_type, handler_len)) {
  +            result = (*handp->hr.handler) (r);
   
  -        if (result == DECLINED) {
  -            for (handp = wildhandlers; handp->hr.content_type; ++handp) {
  -    	        if (handler_len >= handp->len
  -	            && !strncmp(handler, handp->hr.content_type, handp->len)) {
  -                    result = (*handp->hr.handler) (r);
  -
  -                    if (result != DECLINED)
  -                        break;
  -                 }
  -            }
  +            if (result != DECLINED)
  +                return result;
           }
  -    } while (result == RERUN_HANDLERS);
  +    }
  +
  +    /* Pass two --- wildcard matches */
  +
  +    for (handp = wildhandlers; handp->hr.content_type; ++handp) {
  +        if (handler_len >= handp->len
  +            && !strncmp(handler, handp->hr.content_type, handp->len)) {
  +            result = (*handp->hr.handler) (r);
  +
  +            if (result != DECLINED)
  +                return result;
  +         }
  +    }
   
       if (result == HTTP_INTERNAL_SERVER_ERROR && r->handler && r->filename) {
           ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_WARNING, 0, r,
               "handler \"%s\" not found for: %s", r->handler, r->filename);
  -        return HTTP_INTERNAL_SERVER_ERROR;
       }
  - 
  -    return result;
  +    return HTTP_INTERNAL_SERVER_ERROR;
   }
   
   int g_bDebugHooks;