You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by dg...@hyperreal.org on 1998/03/12 12:03:10 UTC

cvs commit: apache-1.3/src/modules/standard mod_access.c mod_actions.c mod_auth_anon.c mod_env.c mod_expires.c mod_headers.c mod_log_referer.c mod_negotiation.c mod_rewrite.c mod_so.c mod_userdir.c mod_usertrack.c

dgaudet     98/03/12 03:03:10

  Modified:    src/modules/standard mod_access.c mod_actions.c
                        mod_auth_anon.c mod_env.c mod_expires.c
                        mod_headers.c mod_log_referer.c mod_negotiation.c
                        mod_rewrite.c mod_so.c mod_userdir.c
                        mod_usertrack.c
  Log:
  Waste less memory.  I didn't really put a lot of effort into savings in
  mod_rewrite or mod_autoindex.
  
  Revision  Changes    Path
  1.31      +1 -1      apache-1.3/src/modules/standard/mod_access.c
  
  Index: mod_access.c
  ===================================================================
  RCS file: /export/home/cvs/apache-1.3/src/modules/standard/mod_access.c,v
  retrieving revision 1.30
  retrieving revision 1.31
  diff -u -r1.30 -r1.31
  --- mod_access.c	1998/01/28 11:33:25	1.30
  +++ mod_access.c	1998/03/12 11:02:59	1.31
  @@ -149,7 +149,7 @@
   	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->x.from = where;
       a->limited = cmd->limited;
   
       if (!strncasecmp(where, "env=", 4)) {
  
  
  
  1.22      +4 -4      apache-1.3/src/modules/standard/mod_actions.c
  
  Index: mod_actions.c
  ===================================================================
  RCS file: /export/home/cvs/apache-1.3/src/modules/standard/mod_actions.c,v
  retrieving revision 1.21
  retrieving revision 1.22
  diff -u -r1.21 -r1.22
  --- mod_actions.c	1998/01/07 16:46:42	1.21
  +++ mod_actions.c	1998/03/12 11:02:59	1.22
  @@ -129,13 +129,13 @@
   			      char *script)
   {
       if (!strcmp(method, "GET"))
  -	m->get = pstrdup(cmd->pool, script);
  +	m->get = script;
       else if (!strcmp(method, "POST"))
  -	m->post = pstrdup(cmd->pool, script);
  +	m->post = script;
       else if (!strcmp(method, "PUT"))
  -	m->put = pstrdup(cmd->pool, script);
  +	m->put = script;
       else if (!strcmp(method, "DELETE"))
  -	m->delete = pstrdup(cmd->pool, script);
  +	m->delete = script;
       else
   	return "Unknown method type for Script";
   
  
  
  
  1.30      +1 -1      apache-1.3/src/modules/standard/mod_auth_anon.c
  
  Index: mod_auth_anon.c
  ===================================================================
  RCS file: /export/home/cvs/apache-1.3/src/modules/standard/mod_auth_anon.c,v
  retrieving revision 1.29
  retrieving revision 1.30
  diff -u -r1.29 -r1.30
  --- mod_auth_anon.c	1998/01/07 16:46:44	1.29
  +++ mod_auth_anon.c	1998/03/12 11:03:01	1.30
  @@ -177,7 +177,7 @@
   
       if (
   	   (!(sec->auth_anon_passwords = (auth_anon *) palloc(cmd->pool, sizeof(auth_anon)))) ||
  -           (!(sec->auth_anon_passwords->password = pstrdup(cmd->pool, arg)))
  +           (!(sec->auth_anon_passwords->password = arg))
       )
   	     return "Failed to claim memory for an anonymous password...";
   
  
  
  
  1.20      +4 -4      apache-1.3/src/modules/standard/mod_env.c
  
  Index: mod_env.c
  ===================================================================
  RCS file: /export/home/cvs/apache-1.3/src/modules/standard/mod_env.c,v
  retrieving revision 1.19
  retrieving revision 1.20
  diff -u -r1.19 -r1.20
  --- mod_env.c	1998/01/24 19:00:24	1.19
  +++ mod_env.c	1998/03/12 11:03:01	1.20
  @@ -145,7 +145,7 @@
       elts = (table_entry *)arr->elts;
   
       for (i = 0; i < arr->nelts; ++i) {
  -        table_set(new_table, elts[i].key, elts[i].val);
  +        table_setn(new_table, elts[i].key, elts[i].val);
       }
   
       unset = add->unsetenv;
  @@ -176,7 +176,7 @@
           env_var = getenv(name_ptr);
           if (env_var != NULL) {
               sconf->vars_present = 1;
  -            table_set(vars, name_ptr, env_var);
  +            table_setn(vars, name_ptr, pstrdup(cmd->pool, env_var));
           }
       }
       return NULL;
  @@ -203,7 +203,7 @@
       }
   
       sconf->vars_present = 1;
  -    table_set(vars, name, value);
  +    table_setn(vars, name, value);
   
       return NULL;
   }
  @@ -215,7 +215,7 @@
       get_module_config(cmd->server->module_config, &env_module);
       sconf->unsetenv = sconf->unsetenv ?
           pstrcat(cmd->pool, sconf->unsetenv, " ", arg, NULL) :
  -         pstrdup(cmd->pool, arg);
  +         arg;
       return NULL;
   }
   
  
  
  
  1.23      +3 -3      apache-1.3/src/modules/standard/mod_expires.c
  
  Index: mod_expires.c
  ===================================================================
  RCS file: /export/home/cvs/apache-1.3/src/modules/standard/mod_expires.c,v
  retrieving revision 1.22
  retrieving revision 1.23
  diff -u -r1.22 -r1.23
  --- mod_expires.c	1998/01/26 19:50:20	1.22
  +++ mod_expires.c	1998/03/12 11:03:02	1.23
  @@ -247,7 +247,7 @@
       /* 0.0.4 compatibility?
        */
       if ((code[0] == 'A') || (code[0] == 'M')) {
  -        *real_code = pstrdup(p, code);
  +        *real_code = (char *)code;
           return NULL;
       };
   
  @@ -344,7 +344,7 @@
       char *response, *real_code;
   
       if ((response = check_code(cmd->pool, code, &real_code)) == NULL) {
  -        table_set(dir_config->expiresbytype, mime, real_code);
  +        table_setn(dir_config->expiresbytype, mime, real_code);
           return NULL;
       };
       return pstrcat(cmd->pool,
  @@ -356,7 +356,7 @@
       char *response, *real_code;
   
       if ((response = check_code(cmd->pool, code, &real_code)) == NULL) {
  -        dir_config->expiresdefault = pstrdup(cmd->pool, real_code);
  +        dir_config->expiresdefault = real_code;
           return NULL;
       };
       return pstrcat(cmd->pool,
  
  
  
  1.13      +2 -2      apache-1.3/src/modules/standard/mod_headers.c
  
  Index: mod_headers.c
  ===================================================================
  RCS file: /export/home/cvs/apache-1.3/src/modules/standard/mod_headers.c,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- mod_headers.c	1998/01/07 16:46:49	1.12
  +++ mod_headers.c	1998/03/12 11:03:02	1.13
  @@ -185,8 +185,8 @@
       if ((colon = strchr(hdr, ':')))
           *colon = '\0';
   
  -    new->header = pstrdup(cmd->pool, hdr);
  -    new->value = value ? pstrdup(cmd->pool, value) : NULL;
  +    new->header = hdr;
  +    new->value = value;
   
       return NULL;
   }
  
  
  
  1.21      +1 -1      apache-1.3/src/modules/standard/mod_log_referer.c
  
  Index: mod_log_referer.c
  ===================================================================
  RCS file: /export/home/cvs/apache-1.3/src/modules/standard/mod_log_referer.c,v
  retrieving revision 1.20
  retrieving revision 1.21
  diff -u -r1.20 -r1.21
  --- mod_log_referer.c	1998/01/07 16:46:52	1.20
  +++ mod_log_referer.c	1998/03/12 11:03:03	1.21
  @@ -99,7 +99,7 @@
                                                  &referer_log_module);
   
       addme = push_array(cls->referer_ignore_list);
  -    *addme = pstrdup(cls->referer_ignore_list->pool, arg);
  +    *addme = arg;
       return NULL;
   }
   
  
  
  
  1.73      +1 -1      apache-1.3/src/modules/standard/mod_negotiation.c
  
  Index: mod_negotiation.c
  ===================================================================
  RCS file: /export/home/cvs/apache-1.3/src/modules/standard/mod_negotiation.c,v
  retrieving revision 1.72
  retrieving revision 1.73
  diff -u -r1.72 -r1.73
  --- mod_negotiation.c	1998/03/12 10:29:07	1.72
  +++ mod_negotiation.c	1998/03/12 11:03:03	1.73
  @@ -120,7 +120,7 @@
       array_header *arr = ((neg_dir_config *) n)->language_priority;
       char **langp = (char **) push_array(arr);
   
  -    *langp = pstrdup(arr->pool, lang);
  +    *langp = lang;
       return NULL;
   }
   
  
  
  
  1.92      +13 -13    apache-1.3/src/modules/standard/mod_rewrite.c
  
  Index: mod_rewrite.c
  ===================================================================
  RCS file: /export/home/cvs/apache-1.3/src/modules/standard/mod_rewrite.c,v
  retrieving revision 1.91
  retrieving revision 1.92
  diff -u -r1.91 -r1.92
  --- mod_rewrite.c	1998/03/12 10:29:08	1.91
  +++ mod_rewrite.c	1998/03/12 11:03:04	1.92
  @@ -521,7 +521,7 @@
       if (a1[0] == '\0')
           return "RewriteBase: empty URL not allowed";
   
  -    dconf->baseurl = pstrdup(cmd->pool, a1);
  +    dconf->baseurl = a1;
   
       return NULL;
   }
  @@ -605,7 +605,7 @@
       const char *err;
   
       if (str[0] != '[' || str[strlen(str)-1] != ']')
  -        return pstrdup(p, "RewriteCond: bad flag delimiters");
  +        return "RewriteCond: bad flag delimiters";
   
       cp = str+1;
       str[strlen(str)-1] = ','; /* for simpler parsing */
  @@ -746,7 +746,7 @@
       const char *err;
   
       if (str[0] != '[' || str[strlen(str)-1] != ']')
  -        return pstrdup(p, "RewriteRule: bad flag delimiters");
  +        return "RewriteRule: bad flag delimiters";
   
       cp = str+1;
       str[strlen(str)-1] = ','; /* for simpler parsing */
  @@ -800,8 +800,8 @@
               else if (isdigit(*val))
                   status = atoi(val);
               if (!is_HTTP_REDIRECT(status))
  -                return pstrdup(p, "RewriteRule: invalid HTTP response code "
  -                                  "for flag 'R'");
  +                return "RewriteRule: invalid HTTP response code "
  +			"for flag 'R'";
               cfg->forced_responsecode = status;
           }
       }
  @@ -831,7 +831,7 @@
               cfg->env[i+1] = NULL;
           }
           else
  -            return pstrdup(p, "RewriteRule: to many environment flags 'E'");
  +            return "RewriteRule: to many environment flags 'E'";
       }
       else if (   strcasecmp(key, "nosubreq") == 0
                || strcasecmp(key, "NS") == 0      ) {
  @@ -3337,7 +3337,7 @@
           result = r->protocol;
       }
       else if (strcasecmp(var, "SERVER_SOFTWARE") == 0) {
  -        result = pstrdup(r->pool, apapi_get_server_version());
  +        result = apapi_get_server_version();
       }
       else if (strcasecmp(var, "API_VERSION") == 0) { /* non-standard */
           ap_snprintf(resultbuf, sizeof(resultbuf), "%d", MODULE_MAGIC_NUMBER);
  @@ -3438,31 +3438,31 @@
   
       /* file stuff */
       else if (strcasecmp(var, "SCRIPT_USER") == 0) {
  -        result = pstrdup(r->pool, "<unknown>");
  +	result = "<unknown>";
           if (r->finfo.st_mode != 0) {
               if ((pw = getpwuid(r->finfo.st_uid)) != NULL) {
  -                result = pstrdup(r->pool, pw->pw_name);
  +                result = pw->pw_name;
               }
           }
           else {
               if (stat(r->filename, &finfo) == 0) {
                   if ((pw = getpwuid(finfo.st_uid)) != NULL) {
  -                    result = pstrdup(r->pool, pw->pw_name);
  +                    result = pw->pw_name;
                   }
               }
           }
       }
       else if (strcasecmp(var, "SCRIPT_GROUP") == 0) {
  -        result = pstrdup(r->pool, "<unknown>");
  +	result = "<unknown>";
           if (r->finfo.st_mode != 0) {
               if ((gr = getgrgid(r->finfo.st_gid)) != NULL) {
  -                result = pstrdup(r->pool, gr->gr_name);
  +                result = gr->gr_name;
               }
           }
           else {
               if (stat(r->filename, &finfo) == 0) {
                   if ((gr = getgrgid(finfo.st_gid)) != NULL) {
  -                    result = pstrdup(r->pool, gr->gr_name);
  +                    result = gr->gr_name;
                   }
               }
           }
  
  
  
  1.9       +1 -1      apache-1.3/src/modules/standard/mod_so.c
  
  Index: mod_so.c
  ===================================================================
  RCS file: /export/home/cvs/apache-1.3/src/modules/standard/mod_so.c,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- mod_so.c	1998/03/10 09:22:32	1.8
  +++ mod_so.c	1998/03/12 11:03:06	1.9
  @@ -251,7 +251,7 @@
               return NULL;
       }
       modi = push_array(sconf->loaded_modules);
  -    modi->name = pstrdup(cmd->pool, modname);
  +    modi->name = modname;
   
       /*
        * Actually load the file into the address space 
  
  
  
  1.30      +1 -1      apache-1.3/src/modules/standard/mod_userdir.c
  
  Index: mod_userdir.c
  ===================================================================
  RCS file: /export/home/cvs/apache-1.3/src/modules/standard/mod_userdir.c,v
  retrieving revision 1.29
  retrieving revision 1.30
  diff -u -r1.29 -r1.30
  --- mod_userdir.c	1998/02/21 00:50:02	1.29
  +++ mod_userdir.c	1998/03/12 11:03:06	1.30
  @@ -193,7 +193,7 @@
       const userdir_config *s_cfg =
       (userdir_config *) get_module_config(server_conf, &userdir_module);
       char *name = r->uri;
  -    const char *userdirs = pstrdup(r->pool, s_cfg->userdir);
  +    const char *userdirs = s_cfg->userdir;
       const char *w, *dname;
       char *redirect;
       char *x = NULL;
  
  
  
  1.28      +2 -3      apache-1.3/src/modules/standard/mod_usertrack.c
  
  Index: mod_usertrack.c
  ===================================================================
  RCS file: /export/home/cvs/apache-1.3/src/modules/standard/mod_usertrack.c,v
  retrieving revision 1.27
  retrieving revision 1.28
  diff -u -r1.27 -r1.28
  --- mod_usertrack.c	1998/03/09 22:43:03	1.27
  +++ mod_usertrack.c	1998/03/12 11:03:07	1.28
  @@ -135,9 +135,8 @@
       char new_cookie[1024];
       char cookiebuf[1024];
       char *dot;
  -    const char *rname = pstrdup(r->pool,
  -                           get_remote_host(r->connection, r->per_dir_config,
  -                                           REMOTE_NAME));
  +    const char *rname = get_remote_host(r->connection, r->per_dir_config,
  +					REMOTE_NAME);
   
       if ((dot = strchr(rname, '.')))
           *dot = '\0';            /* First bit of hostname */