httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jaillet...@apache.org
Subject svn commit: r1713043 - /httpd/httpd/trunk/server/core.c
Date Fri, 06 Nov 2015 21:59:54 GMT
Author: jailletc36
Date: Fri Nov  6 21:59:53 2015
New Revision: 1713043

URL: http://svn.apache.org/viewvc?rev=1713043&view=rev
Log:
Save a few bytes in conf pool when processing 'Define'.

+ some minor style issues
+ split long lines

Modified:
    httpd/httpd/trunk/server/core.c

Modified: httpd/httpd/trunk/server/core.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/core.c?rev=1713043&r1=1713042&r2=1713043&view=diff
==============================================================================
--- httpd/httpd/trunk/server/core.c (original)
+++ httpd/httpd/trunk/server/core.c Fri Nov  6 21:59:53 2015
@@ -1361,21 +1361,25 @@ static const char *set_define(cmd_parms
                               const char *name, const char *value)
 {
     if (cmd->parent && strcasecmp(cmd->parent->directive, "<VirtualHost"))
{ 
-        return apr_pstrcat(cmd->pool, cmd->cmd->name, " is not valid in ", cmd->parent->directive,
" context", NULL);
+        return apr_pstrcat(cmd->pool, cmd->cmd->name, " is not valid in ",
+                                      cmd->parent->directive, " context", NULL);
     }
 
-    if (ap_strchr_c(name, ':') != NULL)
+    if (ap_strchr_c(name, ':') != NULL) {
         return "Variable name must not contain ':'";
+    }
 
-    if (!saved_server_config_defines)
+    if (!saved_server_config_defines) {
         init_config_defines(cmd->pool);
+    }
     if (!ap_exists_config_define(name)) {
-        char **newv = (char **)apr_array_push(ap_server_config_defines);
-        *newv = apr_pstrdup(cmd->pool, name);
+        const char **newv = (const char **)apr_array_push(ap_server_config_defines);
+        *newv = name;
     }
     if (value) {
-        if (!server_config_defined_vars)
+        if (!server_config_defined_vars) {
             server_config_defined_vars = apr_table_make(cmd->pool, 5);
+        }
         apr_table_setn(server_config_defined_vars, name, value);
     }
 
@@ -1388,14 +1392,17 @@ static const char *unset_define(cmd_parm
     int i;
     char **defines;
     if (cmd->parent && strcasecmp(cmd->parent->directive, "<VirtualHost"))
{ 
-        return apr_pstrcat(cmd->pool, cmd->cmd->name, " is not valid in ", cmd->parent->directive,
" context", NULL);
+        return apr_pstrcat(cmd->pool, cmd->cmd->name, " is not valid in ",
+                                      cmd->parent->directive, " context", NULL);
     }
 
-    if (ap_strchr_c(name, ':') != NULL)
+    if (ap_strchr_c(name, ':') != NULL) {
         return "Variable name must not contain ':'";
+    }
 
-    if (!saved_server_config_defines)
+    if (!saved_server_config_defines) {
         init_config_defines(cmd->pool);
+    }
 
     defines = (char **)ap_server_config_defines->elts;
     for (i = 0; i < ap_server_config_defines->nelts; i++) {



Mime
View raw message