]> granicus.if.org Git - apache/commitdiff
A better solution than my previous commit as pointed out by Andre Malo.
authorPaul J. Reder <rederpj@apache.org>
Sat, 22 Nov 2003 02:11:00 +0000 (02:11 +0000)
committerPaul J. Reder <rederpj@apache.org>
Sat, 22 Nov 2003 02:11:00 +0000 (02:11 +0000)
mod_expires: Initialize ExpiresDefault to NULL instead of "" to
avoid reporting an Internal Server error if it is used without
having been set in the httpd.conf file. PR: 23748, 24459
Submitted: Andre Malo, Liam Quinn  <liam htmlhelp.com>
Reviewed: Andre Malo, Paul J. Reder

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@101846 13f79535-47bb-0310-9956-ffa450edef68

CHANGES
modules/metadata/mod_expires.c

diff --git a/CHANGES b/CHANGES
index 6a5d8071b9e43407abca73cc89f5182e25d5fc91..fbbdc5e42f590fd41d42f004b4f6dcd942808b23 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -2,9 +2,10 @@ Changes with Apache 2.1.0-dev
 
   [Remove entries to the current 2.0 section below, when backported]
 
-  *) mod_expires: Don't report an Internal Server error if ExpiresDefault
-     is used and has not been set in the httpd.conf file. PR: 23748, 24459
-     [Liam Quinn  <liam htmlhelp.com>]
+  *) mod_expires: Initialize ExpiresDefault to NULL instead of "" to
+     avoid reporting an Internal Server error if it is used without
+     having been set in the httpd.conf file. PR: 23748, 24459
+     [Andre Malo, Liam Quinn  <liam htmlhelp.com>]
 
   *) mod_logio: Account for some bytes handed to the network layer prior to
      dropped connections.  [Jeff Trawick]
index d7445ad634563e9f76839b38279fae8aaa0a2d47..44a63d56d7f55d1160230ae9e5a344af1d8ff5cc 100644 (file)
@@ -229,7 +229,7 @@ static void *create_dir_expires_config(apr_pool_t *p, char *dummy)
     (expires_dir_config *) apr_pcalloc(p, sizeof(expires_dir_config));
     new->active = ACTIVE_DONTCARE;
     new->wildcards = 0;
-    new->expiresdefault = "";
+    new->expiresdefault = NULL;
     new->expiresbytype = apr_table_make(p, 4);
     return (void *) new;
 }
@@ -412,7 +412,7 @@ static void *merge_expires_dir_configs(apr_pool_t *p, void *basev, void *addv)
         new->active = add->active;
     }
 
-    if (add->expiresdefault[0] != '\0') {
+    if (add->expiresdefault != NULL) {
         new->expiresdefault = add->expiresdefault;
     }
     else {
@@ -548,8 +548,7 @@ static apr_status_t expires_filter(ap_filter_t *f,
                 expiry = conf->expiresdefault;
             }
         }
-        /* != '\0' covers the case where ExpiresDefault is not user defined. */
-        if (expiry != NULL && expiry[0] != '\0') {
+        if (expiry != NULL) {
             set_expiration_fields(r, expiry, t);
         }
     }