]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
Goodbye r->content_lanaguage (per vote from apache-1.3/STATUS).
authorWilliam A. Rowe Jr <wrowe@apache.org>
Tue, 2 Oct 2001 21:13:42 +0000 (21:13 +0000)
committerWilliam A. Rowe Jr <wrowe@apache.org>
Tue, 2 Oct 2001 21:13:42 +0000 (21:13 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@91244 13f79535-47bb-0310-9956-ffa450edef68

CHANGES
include/ap_mmn.h
include/httpd.h
modules/http/http_protocol.c
modules/http/http_request.c
modules/http/mod_mime.c
modules/metadata/mod_mime_magic.c

diff --git a/CHANGES b/CHANGES
index c1c707dcb8ab9bc88c66cd974c6eb32cee975f98..7d0ee15751b63c0234e06021e8a6763d01d4a432 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,5 +1,10 @@
 Changes with Apache 2.0.26-dev
 
+  *) Eliminate the depreciated r->content_language, in favor of the array
+     r->content_languages introduced many years ago.  Module authors must
+     substantially overhaul their modules, so this needs to be upgraded
+     if the module still relied on backwards-brokeness.  [William Rowe]
+
   *) Allow configure help strings to work with autoconf 2.50+ and 2.13.
      [Justin Erenkrantz]
 
index b9eee6dd79e7b39413a278e690687714efcb3312..eb9f8d94ffef5c33cae63f8bfa86ddc86d02b9b6 100644 (file)
  * 20010726 (2.0.22-dev) more big API changes
  * 20010808 (2.0.23-dev) dir d_is_absolute bit introduced, bucket changes, etc
  * 20010825 (2.0.25-dev) removed d_is_absolute, introduced map_to_storage hook
+ * 20011002 (2.0.26-dev) removed 1.3-depreciated request_rec.content_language
  */
 
 #define MODULE_MAGIC_COOKIE 0x41503230UL /* "AP20" */
 
 #ifndef MODULE_MAGIC_NUMBER_MAJOR
-#define MODULE_MAGIC_NUMBER_MAJOR 20010825
+#define MODULE_MAGIC_NUMBER_MAJOR 20011002
 #endif
 #define MODULE_MAGIC_NUMBER_MINOR 0                     /* 0...n */
 #define MODULE_MAGIC_NUMBER MODULE_MAGIC_NUMBER_MAJOR  /* backward compat */
index fbd6fb717ad1c0a83ad7bc756348d413ca32b1c5..17ba9ea9ff38ecc2ef3f3996568ef6f9796f2da2 100644 (file)
@@ -806,9 +806,9 @@ struct request_rec {
     /** Notes from one module to another */
     apr_table_t *notes;
 
-    /* content_type, handler, content_encoding, content_language, and all
-     * content_languages MUST be lowercased strings.  They may be pointers
-     * to static strings; they should not be modified in place.
+    /* content_type, handler, content_encoding, and all content_languages 
+     * MUST be lowercased strings.  They may be pointers to static strings;
+     * they should not be modified in place.
      */
     /** The content-type for the current request */
     const char *content_type;  /* Break these out --- we dispatch on 'em */
@@ -817,8 +817,6 @@ struct request_rec {
 
     /** How to encode the data */
     const char *content_encoding;
-    /** for back-compat. only -- do not use */
-    const char *content_language;
     /** array of (char*) representing the content languages */
     apr_array_header_t *content_languages;
 
index d38e2a1ccaa9717fe8baff904d0abf4de041ef3a..ce93ad346ba7e8a17d23c8f3a64d37e35538c36b 100644 (file)
@@ -1097,10 +1097,6 @@ AP_CORE_DECLARE_NONSTD(apr_status_t) ap_http_header_filter(
             apr_table_mergen(r->headers_out, "Content-Language", languages[i]);
         }
     }
-    else if (r->content_language) {
-        apr_table_setn(r->headers_out, "Content-Language",
-                      r->content_language);
-    }
 
     /*
      * Control cachability for non-cachable responses if not already set by
@@ -1774,7 +1770,6 @@ AP_DECLARE(void) ap_send_error_response(request_rec *r, int recursive_error)
             }
         }
 
-        r->content_language = NULL;
         r->content_languages = NULL;
         r->content_encoding = NULL;
         r->clength = 0;
index e381da59d78297a7c3298801ec90bc204fe6edbd..f7dec6aeb5a9c944a9c09a562db201027f0e73ae 100644 (file)
@@ -424,7 +424,6 @@ AP_DECLARE(void) ap_internal_fast_redirect(request_rec *rr, request_rec *r)
     r->content_type = rr->content_type;
     r->content_encoding = rr->content_encoding;
     r->content_languages = rr->content_languages;
-    r->content_language = rr->content_language;
     r->finfo = rr->finfo;
     r->per_dir_config = rr->per_dir_config;
     /* copy output headers from subrequest, but leave negotiation headers */
index dc36b12218c5248ffba74d01523e676f86883882..9f5fa873be3382bcec778e026d53b102177cd6b1 100644 (file)
@@ -754,12 +754,11 @@ static int find_ct(request_rec *r)
                 found = 1;
             }
             if (exinfo->language_type) {
-                r->content_language = exinfo->language_type; /* back compat. */
                 if (!r->content_languages)
                     r->content_languages = apr_array_make(r->pool, 2,
                                                           sizeof(char *));
-                *((const char **) apr_array_push(r->content_languages)) =
-                    exinfo->language_type;
+                    *((const char **) apr_array_push(r->content_languages))
+                                          = exinfo->language_type;
                 found = 1;
             }
             if (exinfo->encoding_type) {
@@ -863,7 +862,6 @@ static int find_ct(request_rec *r)
     if (!r->content_languages && conf->default_language) {
         const char **new;
 
-        r->content_language = conf->default_language; /* back compat. only */
         if (!r->content_languages)
             r->content_languages = apr_array_make(r->pool, 2, sizeof(char *));
         new = (const char **) apr_array_push(r->content_languages);
index 02bf4598929509c7f33018a5cc44d2b68ecf19f2..932f7e9d67fa64706e5a1027720198fc85f7a213 100644 (file)
@@ -2370,9 +2370,15 @@ static int revision_suffix(request_rec *r)
        if (sub->content_encoding)
            r->content_encoding =
                apr_pstrdup(r->pool, sub->content_encoding);
-       if (sub->content_language)
-           r->content_language =
-               apr_pstrdup(r->pool, sub->content_language);
+        if (sub->content_languages) {
+            int n;
+           r->content_languages = apr_array_copy(r->pool, 
+                                                  sub->content_languages);
+            for (n = 0; n < r->content_languages->nelts; ++n) {
+                char **lang = ((char **)r->content_languages->elts) + n;
+                *lang = apr_pstrdup(r->pool, *lang);
+            }
+        }
        result = 1;
     }