You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by Dean Gaudet <dg...@hyperreal.org> on 1997/09/16 07:32:00 UTC

cvs commit: apachen/src/modules/standard .indent.pro mod_access.c mod_actions.c mod_alias.c mod_asis.c

dgaudet     97/09/15 22:31:58

  Modified:    src      INDENT
               src/modules/standard mod_access.c mod_actions.c mod_alias.c
                        mod_asis.c
  Added:       src/modules/standard .indent.pro
  Log:
  indent
  
  Revision  Changes    Path
  1.26      +4 -4      apachen/src/INDENT
  
  Index: INDENT
  ===================================================================
  RCS file: /export/home/cvs/apachen/src/INDENT,v
  retrieving revision 1.25
  retrieving revision 1.26
  diff -u -r1.25 -r1.26
  --- INDENT	1997/09/16 05:15:36	1.25
  +++ INDENT	1997/09/16 05:31:54	1.26
  @@ -57,10 +57,10 @@
      proxy_util.c			DONE by Dean
   
   ./modules/standard:
  -   mod_access.c			RESERVED by Dean
  -   mod_actions.c		RESERVED by Dean
  -   mod_alias.c			RESERVED by Dean
  -   mod_asis.c			RESERVED by Dean
  +   mod_access.c			DONE by Dean
  +   mod_actions.c		DONE by Dean
  +   mod_alias.c			DONE by Dean
  +   mod_asis.c			DONE by Dean
      mod_auth.c
      mod_auth_anon.c
      mod_auth_db.c
  
  
  
  1.25      +124 -106  apachen/src/modules/standard/mod_access.c
  
  Index: mod_access.c
  ===================================================================
  RCS file: /export/home/cvs/apachen/src/modules/standard/mod_access.c,v
  retrieving revision 1.24
  retrieving revision 1.25
  diff -u -r1.24 -r1.25
  --- mod_access.c	1997/08/31 21:30:59	1.24
  +++ mod_access.c	1997/09/16 05:31:56	1.25
  @@ -96,101 +96,110 @@
   
   module MODULE_VAR_EXPORT access_module;
   
  -static void *create_access_dir_config (pool *p, char *dummy)
  +static void *create_access_dir_config(pool *p, char *dummy)
   {
       access_dir_conf *conf =
  -        (access_dir_conf *)pcalloc(p, sizeof(access_dir_conf));
  +    (access_dir_conf *) pcalloc(p, sizeof(access_dir_conf));
       int i;
  -    
  -    for (i = 0; i < METHODS; ++i) conf->order[i] = DENY_THEN_ALLOW;
  -    conf->allows = make_array (p, 1, sizeof (allowdeny));
  -    conf->denys = make_array (p, 1, sizeof (allowdeny));
  -    
  -    return (void *)conf;
  +
  +    for (i = 0; i < METHODS; ++i)
  +	conf->order[i] = DENY_THEN_ALLOW;
  +    conf->allows = make_array(p, 1, sizeof(allowdeny));
  +    conf->denys = make_array(p, 1, sizeof(allowdeny));
  +
  +    return (void *) conf;
   }
   
  -static const char *order (cmd_parms *cmd, void *dv, char *arg)
  +static const char *order(cmd_parms *cmd, void *dv, char *arg)
   {
  -    access_dir_conf *d = (access_dir_conf *)dv;
  +    access_dir_conf *d = (access_dir_conf *) dv;
       int i, o;
  -  
  -    if (!strcasecmp (arg, "allow,deny")) o = ALLOW_THEN_DENY;
  -    else if (!strcasecmp (arg, "deny,allow")) o = DENY_THEN_ALLOW;
  -    else if (!strcasecmp (arg, "mutual-failure")) o = MUTUAL_FAILURE;
  -    else return "unknown order";
   
  -    for (i = 0; i < METHODS; ++i) 
  -        if (cmd->limited & (1 << i))
  +    if (!strcasecmp(arg, "allow,deny"))
  +	o = ALLOW_THEN_DENY;
  +    else if (!strcasecmp(arg, "deny,allow"))
  +	o = DENY_THEN_ALLOW;
  +    else if (!strcasecmp(arg, "mutual-failure"))
  +	o = MUTUAL_FAILURE;
  +    else
  +	return "unknown order";
  +
  +    for (i = 0; i < METHODS; ++i)
  +	if (cmd->limited & (1 << i))
   	    d->order[i] = o;
  -    
  +
       return NULL;
   }
   
   static int is_ip(const char *host)
   {
       while ((*host == '.') || isdigit(*host))
  -        host++;
  +	host++;
       return (*host == '\0');
   }
   
  -static const char *allow_cmd (cmd_parms *cmd, void *dv, char *from, char *where)
  +static const char *allow_cmd(cmd_parms *cmd, void *dv, char *from, char *where)
   {
  -    access_dir_conf *d = (access_dir_conf *)dv;
  +    access_dir_conf *d = (access_dir_conf *) dv;
       allowdeny *a;
       char *s;
  -  
  -    if (strcasecmp (from, "from"))
  -        return "allow and deny must be followed by 'from'";
  -    
  -    a = (allowdeny *)push_array (cmd->info ? d->allows : d->denys);
  -    a->x.from = where = pstrdup (cmd->pool, where);
  +
  +    if (strcasecmp(from, "from"))
  +	return "allow and deny must be followed by 'from'";
  +
  +    a = (allowdeny *) push_array(cmd->info ? d->allows : d->denys);
  +    a->x.from = where = pstrdup(cmd->pool, where);
       a->limited = cmd->limited;
  -    
  -    if (!strncmp (where, "env=", 4)) {
  +
  +    if (!strncmp(where, "env=", 4)) {
   	a->type = T_ENV;
   	a->x.from += 4;
   
  -    } else if (!strcmp (where, "all")) {
  +    }
  +    else if (!strcmp(where, "all")) {
   	a->type = T_ALL;
   
  -    } else if ((s = strchr (where, '/'))) {
  +    }
  +    else if ((s = strchr(where, '/'))) {
   	unsigned long mask;
   
   	a->type = T_IP;
   	/* trample on where, we won't be using it any more */
   	*s++ = '\0';
   
  -	if (!is_ip (where)
  -	    || (a->x.ip.net = ap_inet_addr (where)) == INADDR_NONE) {
  +	if (!is_ip(where)
  +	    || (a->x.ip.net = ap_inet_addr(where)) == INADDR_NONE) {
   	    a->type = T_FAIL;
   	    return "syntax error in network portion of network/netmask";
   	}
   
   	/* is_ip just tests if it matches [\d.]+ */
  -	if (!is_ip (s)) {
  +	if (!is_ip(s)) {
   	    a->type = T_FAIL;
   	    return "syntax error in mask portion of network/netmask";
   	}
   	/* is it in /a.b.c.d form? */
  -	if (strchr (s, '.')) {
  -	    mask = ap_inet_addr (s);
  +	if (strchr(s, '.')) {
  +	    mask = ap_inet_addr(s);
   	    if (mask == INADDR_NONE) {
   		a->type = T_FAIL;
   		return "syntax error in mask portion of network/netmask";
   	    }
  -	} else {
  +	}
  +	else {
   	    /* assume it's in /nnn form */
  -	    mask = atoi (s);
  +	    mask = atoi(s);
   	    if (mask > 32 || mask <= 0) {
   		a->type = T_FAIL;
   		return "invalid mask in network/netmask";
   	    }
   	    mask = 0xFFFFFFFFUL << (32 - mask);
  -	    mask = htonl (mask);
  +	    mask = htonl(mask);
   	}
   	a->x.ip.mask = mask;
   
  -    } else if (isdigit (*where) && is_ip (where)) {
  +    }
  +    else if (isdigit(*where) && is_ip(where)) {
   	/* legacy syntax for ip addrs: a.b.c. ==> a.b.c.0/24 for example */
   	int shift;
   	char *t;
  @@ -202,16 +211,17 @@
   	shift = 0;
   	while (*s) {
   	    t = s;
  -	    if (!isdigit (*t)) {
  +	    if (!isdigit(*t)) {
   		a->type = T_FAIL;
   		return "invalid ip address";
   	    }
  -	    while (isdigit (*t)) {
  +	    while (isdigit(*t)) {
   		++t;
   	    }
   	    if (*t == '.') {
   		*t++ = 0;
  -	    } else if (*t) {
  +	    }
  +	    else if (*t) {
   		a->type = T_FAIL;
   		return "invalid ip address";
   	    }
  @@ -220,7 +230,8 @@
   	    shift += 8;
   	    s = t;
   	}
  -    } else {
  +    }
  +    else {
   	a->type = T_HOST;
       }
   
  @@ -229,49 +240,55 @@
   
   static char its_an_allow;
   
  -static command_rec access_cmds[] = {
  -{ "order", order, NULL, OR_LIMIT, TAKE1,
  -    "'allow,deny', 'deny,allow', or 'mutual-failure'" },
  -{ "allow", allow_cmd, &its_an_allow, OR_LIMIT, ITERATE2,
  -    "'from' followed by hostnames or IP-address wildcards" },
  -{ "deny", allow_cmd, NULL, OR_LIMIT, ITERATE2,
  -    "'from' followed by hostnames or IP-address wildcards" },
  -{NULL}
  +static command_rec access_cmds[] =
  +{
  +    {"order", order, NULL, OR_LIMIT, TAKE1,
  +     "'allow,deny', 'deny,allow', or 'mutual-failure'"},
  +    {"allow", allow_cmd, &its_an_allow, OR_LIMIT, ITERATE2,
  +     "'from' followed by hostnames or IP-address wildcards"},
  +    {"deny", allow_cmd, NULL, OR_LIMIT, ITERATE2,
  +     "'from' followed by hostnames or IP-address wildcards"},
  +    {NULL}
   };
   
  -static int in_domain(const char *domain, const char *what) {
  -    int dl=strlen(domain);
  -    int wl=strlen(what);
  +static int in_domain(const char *domain, const char *what)
  +{
  +    int dl = strlen(domain);
  +    int wl = strlen(what);
   
  -    if((wl-dl) >= 0) {
  -        if (strcasecmp(domain,&what[wl-dl]) != 0) return 0;
  +    if ((wl - dl) >= 0) {
  +	if (strcasecmp(domain, &what[wl - dl]) != 0)
  +	    return 0;
   
   	/* Make sure we matched an *entire* subdomain --- if the user
   	 * said 'allow from good.com', we don't want people from nogood.com
   	 * to be able to get in.
   	 */
  -	
  -	if (wl == dl) return 1;	/* matched whole thing */
  -	else return (domain[0] == '.' || what[wl - dl - 1] == '.');
  -    } else
  -        return 0;
  +
  +	if (wl == dl)
  +	    return 1;		/* matched whole thing */
  +	else
  +	    return (domain[0] == '.' || what[wl - dl - 1] == '.');
  +    }
  +    else
  +	return 0;
   }
   
  -static int find_allowdeny (request_rec *r, array_header *a, int method)
  +static int find_allowdeny(request_rec *r, array_header *a, int method)
   {
  -    allowdeny *ap = (allowdeny *)a->elts;
  +    allowdeny *ap = (allowdeny *) a->elts;
       int mmask = (1 << method);
       int i;
       int gothost = 0;
       const char *remotehost = NULL;
   
       for (i = 0; i < a->nelts; ++i) {
  -        if (!(mmask & ap[i].limited))
  +	if (!(mmask & ap[i].limited))
   	    continue;
   
   	switch (ap[i].type) {
   	case T_ENV:
  -	    if (table_get (r->subprocess_env, ap[i].x.from)) {
  +	    if (table_get(r->subprocess_env, ap[i].x.from)) {
   		return 1;
   	    }
   	    break;
  @@ -286,7 +303,7 @@
   		return 1;
   	    }
   	    break;
  -	
  +
   	case T_HOST:
   	    if (!gothost) {
   		remotehost = get_remote_host(r->connection, r->per_dir_config,
  @@ -311,39 +328,39 @@
       return 0;
   }
   
  -static int check_dir_access (request_rec *r)
  +static int check_dir_access(request_rec *r)
   {
       int method = r->method_number;
       access_dir_conf *a =
  -        (access_dir_conf *)
  -	   get_module_config (r->per_dir_config, &access_module);
  +    (access_dir_conf *)
  +    get_module_config(r->per_dir_config, &access_module);
       int ret = OK;
  -						
  +
       if (a->order[method] == ALLOW_THEN_DENY) {
  -        ret = FORBIDDEN;
  -        if (find_allowdeny (r, a->allows, method))
  -            ret = OK;
  -        if (find_allowdeny (r, a->denys, method))
  -            ret = FORBIDDEN;
  -    } else if (a->order[method] == DENY_THEN_ALLOW) {
  -        if (find_allowdeny (r, a->denys, method))
  -            ret = FORBIDDEN;
  -        if (find_allowdeny (r, a->allows, method))
  -            ret = OK;
  +	ret = FORBIDDEN;
  +	if (find_allowdeny(r, a->allows, method))
  +	    ret = OK;
  +	if (find_allowdeny(r, a->denys, method))
  +	    ret = FORBIDDEN;
  +    }
  +    else if (a->order[method] == DENY_THEN_ALLOW) {
  +	if (find_allowdeny(r, a->denys, method))
  +	    ret = FORBIDDEN;
  +	if (find_allowdeny(r, a->allows, method))
  +	    ret = OK;
       }
       else {
  -        if (find_allowdeny(r, a->allows, method) 
  +	if (find_allowdeny(r, a->allows, method)
   	    && !find_allowdeny(r, a->denys, method))
   	    ret = OK;
   	else
   	    ret = FORBIDDEN;
       }
   
  -    if (ret == FORBIDDEN && (
  -        satisfies(r) != SATISFY_ANY || !some_auth_required(r)
  -    )) {
  +    if (ret == FORBIDDEN
  +	&& (satisfies(r) != SATISFY_ANY || !some_auth_required(r))) {
   	aplog_error(APLOG_MARK, APLOG_ERR, r->server,
  -		    "Client denied by server configuration: %s", r->filename);
  +		  "Client denied by server configuration: %s", r->filename);
       }
   
       return ret;
  @@ -351,24 +368,25 @@
   
   
   
  -module MODULE_VAR_EXPORT access_module = {
  -   STANDARD_MODULE_STUFF,
  -   NULL,			/* initializer */
  -   create_access_dir_config,	/* dir config creater */
  -   NULL,			/* dir merger --- default is to override */
  -   NULL,			/* server config */
  -   NULL,			/* merge server config */
  -   access_cmds,
  -   NULL,			/* handlers */
  -   NULL,			/* filename translation */
  -   NULL,			/* check_user_id */
  -   NULL,			/* check auth */
  -   check_dir_access,		/* check access */
  -   NULL,			/* type_checker */
  -   NULL,			/* fixups */
  -   NULL,			/* logger */
  -   NULL,			/* header parser */
  -   NULL,			/* child_init */
  -   NULL,			/* child_exit */
  -   NULL				/* post read-request */
  +module MODULE_VAR_EXPORT access_module =
  +{
  +    STANDARD_MODULE_STUFF,
  +    NULL,			/* initializer */
  +    create_access_dir_config,	/* dir config creater */
  +    NULL,			/* dir merger --- default is to override */
  +    NULL,			/* server config */
  +    NULL,			/* merge server config */
  +    access_cmds,
  +    NULL,			/* handlers */
  +    NULL,			/* filename translation */
  +    NULL,			/* check_user_id */
  +    NULL,			/* check auth */
  +    check_dir_access,		/* check access */
  +    NULL,			/* type_checker */
  +    NULL,			/* fixups */
  +    NULL,			/* logger */
  +    NULL,			/* header parser */
  +    NULL,			/* child_init */
  +    NULL,			/* child_exit */
  +    NULL			/* post read-request */
   };
  
  
  
  1.18      +72 -65    apachen/src/modules/standard/mod_actions.c
  
  Index: mod_actions.c
  ===================================================================
  RCS file: /export/home/cvs/apachen/src/modules/standard/mod_actions.c,v
  retrieving revision 1.17
  retrieving revision 1.18
  diff -u -r1.17 -r1.18
  --- mod_actions.c	1997/08/31 21:33:08	1.17
  +++ mod_actions.c	1997/09/16 05:31:56	1.18
  @@ -85,29 +85,29 @@
   
   module action_module;
   
  -static void *create_action_dir_config (pool *p, char *dummy)
  +static void *create_action_dir_config(pool *p, char *dummy)
   {
       action_dir_config *new =
  -      (action_dir_config *) palloc (p, sizeof(action_dir_config));
  +    (action_dir_config *) palloc(p, sizeof(action_dir_config));
   
  -    new->action_types = make_table (p, 4);
  +    new->action_types = make_table(p, 4);
       new->get = NULL;
       new->post = NULL;
       new->put = NULL;
       new->delete = NULL;
  -    
  +
       return new;
   }
   
  -static void *merge_action_dir_configs (pool *p, void *basev, void *addv)
  +static void *merge_action_dir_configs(pool *p, void *basev, void *addv)
   {
  -    action_dir_config *base = (action_dir_config *)basev;
  -    action_dir_config *add = (action_dir_config *)addv;
  +    action_dir_config *base = (action_dir_config *) basev;
  +    action_dir_config *add = (action_dir_config *) addv;
       action_dir_config *new =
  -      (action_dir_config *)palloc (p, sizeof(action_dir_config));
  +    (action_dir_config *) palloc(p, sizeof(action_dir_config));
   
  -    new->action_types = overlay_tables (p, add->action_types,
  -					  base->action_types);
  +    new->action_types = overlay_tables(p, add->action_types,
  +				       base->action_types);
   
       new->get = add->get ? add->get : base->get;
       new->post = add->post ? add->post : base->post;
  @@ -117,107 +117,114 @@
       return new;
   }
   
  -static const char *add_action(cmd_parms *cmd, action_dir_config *m, char *type,
  -		       char *script)
  +static const char *add_action(cmd_parms *cmd, action_dir_config * m, char *type,
  +			      char *script)
   {
  -    table_set (m->action_types, type, script);
  +    table_set(m->action_types, type, script);
       return NULL;
   }
   
  -static const char *set_script (cmd_parms *cmd, action_dir_config *m, char *method,
  -			char *script)
  +static const char *set_script(cmd_parms *cmd, action_dir_config * m, char *method,
  +			      char *script)
   {
       if (!strcmp(method, "GET"))
  -        m->get = pstrdup(cmd->pool, script);
  +	m->get = pstrdup(cmd->pool, script);
       else if (!strcmp(method, "POST"))
  -        m->post = pstrdup(cmd->pool, script);
  +	m->post = pstrdup(cmd->pool, script);
       else if (!strcmp(method, "PUT"))
  -        m->put = pstrdup(cmd->pool, script);
  +	m->put = pstrdup(cmd->pool, script);
       else if (!strcmp(method, "DELETE"))
  -        m->delete = pstrdup(cmd->pool, script);
  +	m->delete = pstrdup(cmd->pool, script);
       else
  -        return "Unknown method type for Script";
  +	return "Unknown method type for Script";
   
       return NULL;
   }
   
  -static command_rec action_cmds[] = {
  -{ "Action", add_action, NULL, OR_FILEINFO, TAKE2, 
  -    "a media type followed by a script name" },
  -{ "Script", set_script, NULL, ACCESS_CONF|RSRC_CONF, TAKE2,
  -    "a method followed by a script name" },
  -{ NULL }
  +static command_rec action_cmds[] =
  +{
  +    {"Action", add_action, NULL, OR_FILEINFO, TAKE2,
  +     "a media type followed by a script name"},
  +    {"Script", set_script, NULL, ACCESS_CONF | RSRC_CONF, TAKE2,
  +     "a method followed by a script name"},
  +    {NULL}
   };
   
  -static int action_handler (request_rec *r)
  +static int action_handler(request_rec *r)
   {
       action_dir_config *conf =
  -      (action_dir_config *)get_module_config(r->per_dir_config,&action_module);
  +    (action_dir_config *) get_module_config(r->per_dir_config, &action_module);
       char *t, *action = r->handler ? r->handler : r->content_type;
       char *script = NULL;
   
       /* Set allowed stuff */
  -    if (conf->get) r->allowed |= (1 << M_GET);
  -    if (conf->post) r->allowed |= (1 << M_POST);
  -    if (conf->put) r->allowed |= (1 << M_PUT);
  -    if (conf->delete) r->allowed |= (1 << M_DELETE);
  +    if (conf->get)
  +	r->allowed |= (1 << M_GET);
  +    if (conf->post)
  +	r->allowed |= (1 << M_POST);
  +    if (conf->put)
  +	r->allowed |= (1 << M_PUT);
  +    if (conf->delete)
  +	r->allowed |= (1 << M_DELETE);
   
       /* First, check for the method-handling scripts */
       if ((r->method_number == M_GET) && r->args && conf->get)
  -        script = conf->get;
  +	script = conf->get;
       else if ((r->method_number == M_POST) && conf->post)
  -        script = conf->post;
  +	script = conf->post;
       else if ((r->method_number == M_PUT) && conf->put)
  -        script = conf->put;
  +	script = conf->put;
       else if ((r->method_number == M_DELETE) && conf->delete)
  -        script = conf->delete;
  +	script = conf->delete;
   
       /* Check for looping, which can happen if the CGI script isn't */
       if (script && r->prev && r->prev->prev)
  -        return DECLINED;
  +	return DECLINED;
   
       /* Second, check for actions (which override the method scripts) */
       if ((t = table_get(conf->action_types,
  -					action ? action : default_type(r)))) {
  -        script = t;
  +		       action ? action : default_type(r)))) {
  +	script = t;
   	if (r->finfo.st_mode == 0) {
   	    aplog_error(APLOG_MARK, APLOG_ERR, r->server,
   			"File does not exist: %s", r->filename);
   	    return NOT_FOUND;
   	}
       }
  -  
  +
       if (script == NULL)
  -        return DECLINED;
  +	return DECLINED;
   
       internal_redirect_handler(pstrcat(r->pool, script, escape_uri(r->pool,
  -			r->uri), r->args ? "?" : NULL, r->args, NULL), r);
  +			  r->uri), r->args ? "?" : NULL, r->args, NULL), r);
       return OK;
   }
   
  -static handler_rec action_handlers[] = {
  -{ "*/*", action_handler },
  -{ NULL }
  +static handler_rec action_handlers[] =
  +{
  +    {"*/*", action_handler},
  +    {NULL}
   };
   
  -module action_module = {
  -   STANDARD_MODULE_STUFF,
  -   NULL,			/* initializer */
  -   create_action_dir_config,	/* dir config creater */
  -   merge_action_dir_configs,	/* dir merger --- default is to override */
  -   NULL,			/* server config */
  -   NULL,			/* merge server config */
  -   action_cmds,			/* command table */
  -   action_handlers,		/* handlers */
  -   NULL,			/* filename translation */
  -   NULL,			/* check_user_id */
  -   NULL,			/* check auth */
  -   NULL,			/* check access */
  -   NULL,			/* type_checker */
  -   NULL,			/* fixups */
  -   NULL,			/* logger */
  -   NULL,			/* header parser */
  -   NULL,			/* child_init */
  -   NULL,			/* child_exit */
  -   NULL				/* post read-request */
  +module action_module =
  +{
  +    STANDARD_MODULE_STUFF,
  +    NULL,			/* initializer */
  +    create_action_dir_config,	/* dir config creater */
  +    merge_action_dir_configs,	/* dir merger --- default is to override */
  +    NULL,			/* server config */
  +    NULL,			/* merge server config */
  +    action_cmds,		/* command table */
  +    action_handlers,		/* handlers */
  +    NULL,			/* filename translation */
  +    NULL,			/* check_user_id */
  +    NULL,			/* check auth */
  +    NULL,			/* check access */
  +    NULL,			/* type_checker */
  +    NULL,			/* fixups */
  +    NULL,			/* logger */
  +    NULL,			/* header parser */
  +    NULL,			/* child_init */
  +    NULL,			/* child_exit */
  +    NULL			/* post read-request */
   };
  
  
  
  1.24      +140 -124  apachen/src/modules/standard/mod_alias.c
  
  Index: mod_alias.c
  ===================================================================
  RCS file: /export/home/cvs/apachen/src/modules/standard/mod_alias.c,v
  retrieving revision 1.23
  retrieving revision 1.24
  diff -u -r1.23 -r1.24
  --- mod_alias.c	1997/08/18 13:12:08	1.23
  +++ mod_alias.c	1997/09/16 05:31:56	1.24
  @@ -80,84 +80,86 @@
   
   module MODULE_VAR_EXPORT alias_module;
   
  -static void *create_alias_config (pool *p, server_rec *s)
  +static void *create_alias_config(pool *p, server_rec *s)
   {
       alias_server_conf *a =
  -      (alias_server_conf *)pcalloc (p, sizeof(alias_server_conf));
  +    (alias_server_conf *) pcalloc(p, sizeof(alias_server_conf));
   
  -    a->aliases = make_array (p, 20, sizeof(alias_entry));
  -    a->redirects = make_array (p, 20, sizeof(alias_entry));
  +    a->aliases = make_array(p, 20, sizeof(alias_entry));
  +    a->redirects = make_array(p, 20, sizeof(alias_entry));
       return a;
   }
   
  -static void *create_alias_dir_config (pool *p, char *d)
  +static void *create_alias_dir_config(pool *p, char *d)
   {
       alias_dir_conf *a =
  -      (alias_dir_conf *)pcalloc (p, sizeof(alias_dir_conf));
  -    a->redirects = make_array (p, 2, sizeof(alias_entry));
  +    (alias_dir_conf *) pcalloc(p, sizeof(alias_dir_conf));
  +    a->redirects = make_array(p, 2, sizeof(alias_entry));
       return a;
   }
   
  -static void *merge_alias_config (pool *p, void *basev, void *overridesv)
  +static void *merge_alias_config(pool *p, void *basev, void *overridesv)
   {
       alias_server_conf *a =
  -	(alias_server_conf *)pcalloc (p, sizeof(alias_server_conf));
  -    alias_server_conf *base = (alias_server_conf *)basev,
  -	*overrides = (alias_server_conf *)overridesv;
  +    (alias_server_conf *) pcalloc(p, sizeof(alias_server_conf));
  +    alias_server_conf *base = (alias_server_conf *) basev, *overrides = (alias_server_conf *) overridesv;
   
  -    a->aliases = append_arrays (p, overrides->aliases, base->aliases);
  -    a->redirects = append_arrays (p, overrides->redirects, base->redirects);
  +    a->aliases = append_arrays(p, overrides->aliases, base->aliases);
  +    a->redirects = append_arrays(p, overrides->redirects, base->redirects);
       return a;
   }
   
  -static void *merge_alias_dir_config (pool *p, void *basev, void *overridesv)
  +static void *merge_alias_dir_config(pool *p, void *basev, void *overridesv)
   {
       alias_dir_conf *a =
  -      (alias_dir_conf *)pcalloc (p, sizeof(alias_dir_conf));
  -    alias_dir_conf *base = (alias_dir_conf *)basev,
  -      *overrides = (alias_dir_conf *)overridesv;
  -    a->redirects = append_arrays (p, overrides->redirects, base->redirects);
  +    (alias_dir_conf *) pcalloc(p, sizeof(alias_dir_conf));
  +    alias_dir_conf *base = (alias_dir_conf *) basev, *overrides = (alias_dir_conf *) overridesv;
  +    a->redirects = append_arrays(p, overrides->redirects, base->redirects);
       return a;
   }
   
   static const char *add_alias_internal(cmd_parms *cmd, void *dummy, char *f, char *r,
  -			       int use_regex)
  +				      int use_regex)
   {
       server_rec *s = cmd->server;
       alias_server_conf *conf =
  -        (alias_server_conf *)get_module_config(s->module_config,&alias_module);
  -    alias_entry *new = push_array (conf->aliases);
  +    (alias_server_conf *) get_module_config(s->module_config, &alias_module);
  +    alias_entry *new = push_array(conf->aliases);
   
       /* XX r can NOT be relative to DocumentRoot here... compat bug. */
  -    
  +
       if (use_regex) {
   	new->regexp = pregcomp(cmd->pool, f, REG_EXTENDED);
   	if (new->regexp == NULL)
   	    return "Regular expression could not be compiled.";
       }
   
  -    new->fake = f; new->real = r; new->handler = cmd->info;
  +    new->fake = f;
  +    new->real = r;
  +    new->handler = cmd->info;
   
       return NULL;
   }
   
  -static const char *add_alias(cmd_parms *cmd, void *dummy, char *f, char *r) {
  +static const char *add_alias(cmd_parms *cmd, void *dummy, char *f, char *r)
  +{
       return add_alias_internal(cmd, dummy, f, r, 0);
   }
   
  -static const char *add_alias_regex(cmd_parms *cmd, void *dummy, char *f, char *r) {
  +static const char *add_alias_regex(cmd_parms *cmd, void *dummy, char *f, char *r)
  +{
       return add_alias_internal(cmd, dummy, f, r, 1);
   }
   
  -static const char *add_redirect_internal(cmd_parms *cmd, alias_dir_conf *dirconf, 
  -				  char *arg1, char *arg2, char *arg3,
  -				  int use_regex)
  +static const char *add_redirect_internal(cmd_parms *cmd, alias_dir_conf * dirconf,
  +					 char *arg1, char *arg2, char *arg3,
  +					 int use_regex)
   {
       alias_entry *new;
       server_rec *s = cmd->server;
       alias_server_conf *serverconf =
  -        (alias_server_conf *)get_module_config(s->module_config,&alias_module);
  -    int status = (int)(long)cmd->info;
  +    (alias_server_conf *) get_module_config(s->module_config, &alias_module);
  +    int status = (int) (long) cmd->info;
       regex_t *r = NULL;
       char *f = arg2;
       char *url = arg3;
  @@ -178,66 +180,74 @@
       }
   
       if (use_regex) {
  -        r = pregcomp(cmd->pool, f, REG_EXTENDED);
  -        if (r == NULL)
  -            return "Regular expression could not be compiled.";
  +	r = pregcomp(cmd->pool, f, REG_EXTENDED);
  +	if (r == NULL)
  +	    return "Regular expression could not be compiled.";
       }
   
       if (is_HTTP_REDIRECT(status)) {
  -	if (!url) return "URL to redirect to is missing";
  -	if (!is_url (url)) return "Redirect to non-URL";
  +	if (!url)
  +	    return "URL to redirect to is missing";
  +	if (!is_url(url))
  +	    return "Redirect to non-URL";
       }
       else {
  -	if (url) return "Redirect URL not valid for this status";
  +	if (url)
  +	    return "Redirect URL not valid for this status";
       }
   
  -    if ( cmd->path )
  -        new = push_array (dirconf->redirects);
  +    if (cmd->path)
  +	new = push_array(dirconf->redirects);
       else
  -        new = push_array (serverconf->redirects);
  +	new = push_array(serverconf->redirects);
   
  -    new->fake = f; new->real = url; new->regexp = r;
  +    new->fake = f;
  +    new->real = url;
  +    new->regexp = r;
       new->redir_status = status;
       return NULL;
   }
   
  -static const char *add_redirect(cmd_parms *cmd, alias_dir_conf *dirconf, char *arg1,
  -			 char *arg2, char *arg3) {
  +static const char *add_redirect(cmd_parms *cmd, alias_dir_conf * dirconf, char *arg1,
  +				char *arg2, char *arg3)
  +{
       return add_redirect_internal(cmd, dirconf, arg1, arg2, arg3, 0);
   }
   
  -static const char *add_redirect_regex(cmd_parms *cmd, alias_dir_conf *dirconf,
  -			       char *arg1, char *arg2, char *arg3) {
  +static const char *add_redirect_regex(cmd_parms *cmd, alias_dir_conf * dirconf,
  +				      char *arg1, char *arg2, char *arg3)
  +{
       return add_redirect_internal(cmd, dirconf, arg1, arg2, arg3, 1);
   }
   
  -static command_rec alias_cmds[] = {
  -{ "Alias", add_alias, NULL, RSRC_CONF, TAKE2, 
  -    "a fakename and a realname"},
  -{ "ScriptAlias", add_alias, "cgi-script", RSRC_CONF, TAKE2, 
  -    "a fakename and a realname"},
  -{ "Redirect", add_redirect, (void*)HTTP_MOVED_TEMPORARILY, 
  -    OR_FILEINFO, TAKE23, 
  -    "an optional status, then document to be redirected and destination URL" },
  -{ "AliasMatch", add_alias_regex, NULL, RSRC_CONF, TAKE2, 
  -    "a regular expression and a filename"},
  -{ "ScriptAliasMatch", add_alias_regex, "cgi-script", RSRC_CONF, TAKE2, 
  -    "a regular expression and a filename"},
  -{ "RedirectMatch", add_redirect_regex, (void*)HTTP_MOVED_TEMPORARILY, 
  -    OR_FILEINFO, TAKE23, 
  -    "an optional status, then a regular expression and destination URL" },
  -{ "RedirectTemp", add_redirect, (void*)HTTP_MOVED_TEMPORARILY, 
  -    OR_FILEINFO, TAKE2, 
  -    "a document to be redirected, then the destination URL" },
  -{ "RedirectPermanent", add_redirect, (void*)HTTP_MOVED_PERMANENTLY, 
  -    OR_FILEINFO, TAKE2, 
  -      "a document to be redirected, then the destination URL" },
  -{ NULL }
  +static command_rec alias_cmds[] =
  +{
  +    {"Alias", add_alias, NULL, RSRC_CONF, TAKE2,
  +     "a fakename and a realname"},
  +    {"ScriptAlias", add_alias, "cgi-script", RSRC_CONF, TAKE2,
  +     "a fakename and a realname"},
  +    {"Redirect", add_redirect, (void *) HTTP_MOVED_TEMPORARILY,
  +     OR_FILEINFO, TAKE23,
  +  "an optional status, then document to be redirected and destination URL"},
  +    {"AliasMatch", add_alias_regex, NULL, RSRC_CONF, TAKE2,
  +     "a regular expression and a filename"},
  +    {"ScriptAliasMatch", add_alias_regex, "cgi-script", RSRC_CONF, TAKE2,
  +     "a regular expression and a filename"},
  +    {"RedirectMatch", add_redirect_regex, (void *) HTTP_MOVED_TEMPORARILY,
  +     OR_FILEINFO, TAKE23,
  +     "an optional status, then a regular expression and destination URL"},
  +    {"RedirectTemp", add_redirect, (void *) HTTP_MOVED_TEMPORARILY,
  +     OR_FILEINFO, TAKE2,
  +     "a document to be redirected, then the destination URL"},
  +    {"RedirectPermanent", add_redirect, (void *) HTTP_MOVED_PERMANENTLY,
  +     OR_FILEINFO, TAKE2,
  +     "a document to be redirected, then the destination URL"},
  +    {NULL}
   };
   
  -static int alias_matches (char *uri, char *alias_fakename)
  +static int alias_matches(char *uri, char *alias_fakename)
   {
  -    char *end_fakename = alias_fakename + strlen (alias_fakename);
  +    char *end_fakename = alias_fakename + strlen(alias_fakename);
       char *aliasp = alias_fakename, *urip = uri;
   
       while (aliasp < end_fakename) {
  @@ -245,14 +255,18 @@
   	    /* any number of '/' in the alias matches any number in
   	     * the supplied URI, but there must be at least one...
   	     */
  -	    if (*urip != '/') return 0;
  -	    
  -	    while (*aliasp == '/') ++ aliasp;
  -	    while (*urip == '/') ++ urip;
  +	    if (*urip != '/')
  +		return 0;
  +
  +	    while (*aliasp == '/')
  +		++aliasp;
  +	    while (*urip == '/')
  +		++urip;
   	}
   	else {
   	    /* Other characters are compared literally */
  -	    if (*urip++ != *aliasp++) return 0;
  +	    if (*urip++ != *aliasp++)
  +		return 0;
   	}
       }
   
  @@ -269,47 +283,48 @@
       return urip - uri;
   }
   
  -static char *try_alias_list (request_rec *r, array_header *aliases, int doesc, int *status)
  +static char *try_alias_list(request_rec *r, array_header *aliases, int doesc, int *status)
   {
  -    alias_entry *entries = (alias_entry *)aliases->elts;
  +    alias_entry *entries = (alias_entry *) aliases->elts;
       regmatch_t regm[10];
       char *found = NULL;
       int i;
  -    
  +
       for (i = 0; i < aliases->nelts; ++i) {
  -        alias_entry *p = &entries[i];
  +	alias_entry *p = &entries[i];
   	int l;
   
   	if (p->regexp) {
  -	    if (!regexec(p->regexp, r->uri, p->regexp->re_nsub+1, regm, 0))
  +	    if (!regexec(p->regexp, r->uri, p->regexp->re_nsub + 1, regm, 0))
   		found = pregsub(r->pool, p->real, r->uri,
  -				p->regexp->re_nsub+1, regm);
  +				p->regexp->re_nsub + 1, regm);
   	}
   	else {
  -	    l = alias_matches (r->uri, p->fake);
  +	    l = alias_matches(r->uri, p->fake);
   
   	    if (l > 0) {
   		if (doesc) {
   		    char *escurl;
   		    escurl = os_escape_path(r->pool, r->uri + l, 1);
  -		    
  +
   		    found = pstrcat(r->pool, p->real, escurl, NULL);
  -		} else
  +		}
  +		else
   		    found = pstrcat(r->pool, p->real, r->uri + l, NULL);
   	    }
   	}
   
   	if (found) {
  -	    if (p->handler) { /* Set handler, and leave a note for mod_cgi */
  +	    if (p->handler) {	/* Set handler, and leave a note for mod_cgi */
   		r->handler = pstrdup(r->pool, p->handler);
  -		table_set (r->notes, "alias-forced-type", p->handler);
  +		table_set(r->notes, "alias-forced-type", p->handler);
   	    }
  -	    
  +
   	    *status = p->redir_status;
   
   	    return found;
   	}
  -	
  +
       }
   
       return NULL;
  @@ -319,34 +334,34 @@
   {
       void *sconf = r->server->module_config;
       alias_server_conf *serverconf =
  -        (alias_server_conf *)get_module_config(sconf, &alias_module);
  +    (alias_server_conf *) get_module_config(sconf, &alias_module);
       char *ret;
       int status;
   
   #if defined(__EMX__) || defined(WIN32)
       /* Add support for OS/2 drive names */
       if ((r->uri[0] != '/' && r->uri[0] != '\0') && r->uri[1] != ':')
  -#else    
  -    if (r->uri[0] != '/' && r->uri[0] != '\0') 
  -#endif    
  -        return DECLINED;
  +#else
  +    if (r->uri[0] != '/' && r->uri[0] != '\0')
  +#endif
  +	return DECLINED;
   
  -    if ((ret = try_alias_list (r, serverconf->redirects, 1, &status)) != NULL) {
  +    if ((ret = try_alias_list(r, serverconf->redirects, 1, &status)) != NULL) {
   	if (is_HTTP_REDIRECT(status)) {
   	    /* include QUERY_STRING if any */
   	    if (r->args) {
  -		ret = pstrcat (r->pool, ret, "?", r->args, NULL);
  +		ret = pstrcat(r->pool, ret, "?", r->args, NULL);
   	    }
  -	    table_set (r->headers_out, "Location", ret);
  +	    table_set(r->headers_out, "Location", ret);
   	}
  -        return status;
  +	return status;
       }
  -    
  -    if ((ret = try_alias_list (r, serverconf->aliases, 0, &status)) != NULL) {
  -        r->filename = ret;
  -        return OK;
  +
  +    if ((ret = try_alias_list(r, serverconf->aliases, 0, &status)) != NULL) {
  +	r->filename = ret;
  +	return OK;
       }
  -    
  +
       return DECLINED;
   }
   
  @@ -354,39 +369,40 @@
   {
       void *dconf = r->per_dir_config;
       alias_dir_conf *dirconf =
  -        (alias_dir_conf *)get_module_config(dconf, &alias_module);
  +    (alias_dir_conf *) get_module_config(dconf, &alias_module);
       char *ret;
       int status;
   
       /* It may have changed since last time, so try again */
   
  -    if ((ret = try_alias_list (r, dirconf->redirects, 1, &status)) != NULL) {
  +    if ((ret = try_alias_list(r, dirconf->redirects, 1, &status)) != NULL) {
   	if (is_HTTP_REDIRECT(status))
  -	    table_set (r->headers_out, "Location", ret);
  -        return status;
  +	    table_set(r->headers_out, "Location", ret);
  +	return status;
       }
   
       return DECLINED;
   }
   
  -module MODULE_VAR_EXPORT alias_module = {
  -   STANDARD_MODULE_STUFF,
  -   NULL,			/* initializer */
  -   create_alias_dir_config,	/* dir config creater */
  -   merge_alias_dir_config,	/* dir merger --- default is to override */
  -   create_alias_config,		/* server config */
  -   merge_alias_config,		/* merge server configs */
  -   alias_cmds,			/* command table */
  -   NULL,			/* handlers */
  -   translate_alias_redir,	/* filename translation */
  -   NULL,			/* check_user_id */
  -   NULL,			/* check auth */
  -   NULL,			/* check access */
  -   NULL,			/* type_checker */
  -   fixup_redir,			/* fixups */
  -   NULL,			/* logger */
  -   NULL,			/* header parser */
  -   NULL,			/* child_init */
  -   NULL,			/* child_exit */
  -   NULL				/* post read-request */
  +module MODULE_VAR_EXPORT alias_module =
  +{
  +    STANDARD_MODULE_STUFF,
  +    NULL,			/* initializer */
  +    create_alias_dir_config,	/* dir config creater */
  +    merge_alias_dir_config,	/* dir merger --- default is to override */
  +    create_alias_config,	/* server config */
  +    merge_alias_config,		/* merge server configs */
  +    alias_cmds,			/* command table */
  +    NULL,			/* handlers */
  +    translate_alias_redir,	/* filename translation */
  +    NULL,			/* check_user_id */
  +    NULL,			/* check auth */
  +    NULL,			/* check access */
  +    NULL,			/* type_checker */
  +    fixup_redir,		/* fixups */
  +    NULL,			/* logger */
  +    NULL,			/* header parser */
  +    NULL,			/* child_init */
  +    NULL,			/* child_exit */
  +    NULL			/* post read-request */
   };
  
  
  
  1.20      +43 -39    apachen/src/modules/standard/mod_asis.c
  
  Index: mod_asis.c
  ===================================================================
  RCS file: /export/home/cvs/apachen/src/modules/standard/mod_asis.c,v
  retrieving revision 1.19
  retrieving revision 1.20
  diff -u -r1.19 -r1.20
  --- mod_asis.c	1997/08/31 21:35:58	1.19
  +++ mod_asis.c	1997/09/16 05:31:56	1.20
  @@ -58,78 +58,82 @@
   #include "http_main.h"
   #include "http_request.h"
   
  -static int asis_handler (request_rec *r)
  +static int asis_handler(request_rec *r)
   {
       FILE *f;
       char *location;
  -    
  -    if (r->method_number != M_GET) return DECLINED;
  +
  +    if (r->method_number != M_GET)
  +	return DECLINED;
       if (r->finfo.st_mode == 0) {
   	aplog_error(APLOG_MARK, APLOG_ERR, r->server,
   		    "File does not exist", r->filename);
   	return NOT_FOUND;
       }
  -	
  +
       f = pfopen(r->pool, r->filename, "r");
   
       if (f == NULL) {
  -        aplog_error(APLOG_MARK, APLOG_ERR, r->server,
  +	aplog_error(APLOG_MARK, APLOG_ERR, r->server,
   		    "file permissions deny server access: %s", r->filename);
  -        return FORBIDDEN;
  +	return FORBIDDEN;
       }
  -      
  +
       scan_script_header(r, f);
       location = table_get(r->headers_out, "Location");
   
  -    if (location && location[0] == '/' && 
  -        ((r->status == HTTP_OK) || is_HTTP_REDIRECT(r->status))) {
  +    if (location && location[0] == '/' &&
  +	((r->status == HTTP_OK) || is_HTTP_REDIRECT(r->status))) {
   
  -        pfclose(r->pool, f);
  +	pfclose(r->pool, f);
   
  -        /* Internal redirect -- fake-up a pseudo-request */
  -        r->status = HTTP_OK;
  +	/* Internal redirect -- fake-up a pseudo-request */
  +	r->status = HTTP_OK;
   
   	/* This redirect needs to be a GET no matter what the original
   	 * method was.
  -	*/
  +	 */
   	r->method = pstrdup(r->pool, "GET");
   	r->method_number = M_GET;
   
   	internal_redirect_handler(location, r);
   	return OK;
       }
  -    
  +
       send_http_header(r);
  -    if (!r->header_only) send_fd (f, r);
  +    if (!r->header_only)
  +	send_fd(f, r);
   
       pfclose(r->pool, f);
       return OK;
   }
   
  -static handler_rec asis_handlers[] = {
  -{ ASIS_MAGIC_TYPE, asis_handler },
  -{ "send-as-is", asis_handler },
  -{ NULL }
  +static handler_rec asis_handlers[] =
  +{
  +    {ASIS_MAGIC_TYPE, asis_handler},
  +    {"send-as-is", asis_handler},
  +    {NULL}
   };
   
  -module MODULE_VAR_EXPORT asis_module = {
  -   STANDARD_MODULE_STUFF,
  -   NULL,			/* initializer */
  -   NULL,			/* create per-directory config structure */
  -   NULL,			/* merge per-directory config structures */
  -   NULL,			/* create per-server config structure */
  -   NULL,			/* merge per-server config structures */
  -   NULL,			/* command table */
  -   asis_handlers,		/* handlers */
  -   NULL,			/* translate_handler */
  -   NULL,			/* check_user_id */
  -   NULL,			/* check auth */
  -   NULL,			/* check access */
  -   NULL,			/* type_checker */
  -   NULL,			/* pre-run fixups */
  -   NULL,			/* logger */
  -   NULL,			/* header parser */
  -   NULL,			/* child_init */
  -   NULL,			/* child_exit */
  -   NULL				/* post read-request */
  +module MODULE_VAR_EXPORT asis_module =
  +{
  +    STANDARD_MODULE_STUFF,
  +    NULL,			/* initializer */
  +    NULL,			/* create per-directory config structure */
  +    NULL,			/* merge per-directory config structures */
  +    NULL,			/* create per-server config structure */
  +    NULL,			/* merge per-server config structures */
  +    NULL,			/* command table */
  +    asis_handlers,		/* handlers */
  +    NULL,			/* translate_handler */
  +    NULL,			/* check_user_id */
  +    NULL,			/* check auth */
  +    NULL,			/* check access */
  +    NULL,			/* type_checker */
  +    NULL,			/* pre-run fixups */
  +    NULL,			/* logger */
  +    NULL,			/* header parser */
  +    NULL,			/* child_init */
  +    NULL,			/* child_exit */
  +    NULL			/* post read-request */
   };
  
  
  
  1.1                  apachen/src/modules/standard/.indent.pro
  
  Index: .indent.pro
  ===================================================================
  -i4 -npsl -di0 -br -nce -d0 -cli0 -npcs -nfc1
  -TBUFF
  -TFILE
  -TTRANS
  -TUINT4
  -T_trans
  -Tallow_options_t
  -Tapache_sfio
  -Tarray_header
  -Tbool_int
  -Tbuf_area
  -Tbuff_struct
  -Tbuffy
  -Tcmd_how
  -Tcmd_parms
  -Tcommand_rec
  -Tcommand_struct
  -Tconn_rec
  -Tcore_dir_config
  -Tcore_server_config
  -Tdir_maker_func
  -Tevent
  -Tglobals_s
  -Thandler_func
  -Thandler_rec
  -Tjoblist_s
  -Tlisten_rec
  -Tmerger_func
  -Tmode_t
  -Tmodule
  -Tmodule_struct
  -Tmutex
  -Tn_long
  -Tother_child_rec
  -Toverrides_t
  -Tparent_score
  -Tpid_t
  -Tpiped_log
  -Tpool
  -Trequest_rec
  -Trequire_line
  -Trlim_t
  -Tscoreboard
  -Tsemaphore
  -Tserver_addr_rec
  -Tserver_rec
  -Tserver_rec_chain
  -Tshort_score
  -Ttable
  -Ttable_entry
  -Tthread
  -Tu_wide_int
  -Tvtime_t
  -Twide_int