You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by wr...@apache.org on 2001/10/02 23:13:42 UTC

cvs commit: httpd-2.0/modules/metadata mod_mime_magic.c

wrowe       01/10/02 14:13:42

  Modified:    .        CHANGES
               include  ap_mmn.h httpd.h
               modules/http http_protocol.c http_request.c mod_mime.c
               modules/metadata mod_mime_magic.c
  Log:
    Goodbye r->content_lanaguage (per vote from apache-1.3/STATUS).
  
  Revision  Changes    Path
  1.376     +5 -0      httpd-2.0/CHANGES
  
  Index: CHANGES
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/CHANGES,v
  retrieving revision 1.375
  retrieving revision 1.376
  diff -u -r1.375 -r1.376
  --- CHANGES	2001/09/30 07:57:14	1.375
  +++ CHANGES	2001/10/02 21:13:41	1.376
  @@ -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]
   
  
  
  
  1.20      +2 -1      httpd-2.0/include/ap_mmn.h
  
  Index: ap_mmn.h
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/include/ap_mmn.h,v
  retrieving revision 1.19
  retrieving revision 1.20
  diff -u -r1.19 -r1.20
  --- ap_mmn.h	2001/08/26 05:15:09	1.19
  +++ ap_mmn.h	2001/10/02 21:13:41	1.20
  @@ -79,12 +79,13 @@
    * 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 */
  
  
  
  1.167     +3 -5      httpd-2.0/include/httpd.h
  
  Index: httpd.h
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/include/httpd.h,v
  retrieving revision 1.166
  retrieving revision 1.167
  diff -u -r1.166 -r1.167
  --- httpd.h	2001/10/02 04:09:53	1.166
  +++ httpd.h	2001/10/02 21:13:41	1.167
  @@ -806,9 +806,9 @@
       /** 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 @@
   
       /** 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;
   
  
  
  
  1.369     +0 -5      httpd-2.0/modules/http/http_protocol.c
  
  Index: http_protocol.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/modules/http/http_protocol.c,v
  retrieving revision 1.368
  retrieving revision 1.369
  diff -u -r1.368 -r1.369
  --- http_protocol.c	2001/10/01 15:48:15	1.368
  +++ http_protocol.c	2001/10/02 21:13:41	1.369
  @@ -1097,10 +1097,6 @@
               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 @@
               }
           }
   
  -        r->content_language = NULL;
           r->content_languages = NULL;
           r->content_encoding = NULL;
           r->clength = 0;
  
  
  
  1.116     +0 -1      httpd-2.0/modules/http/http_request.c
  
  Index: http_request.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/modules/http/http_request.c,v
  retrieving revision 1.115
  retrieving revision 1.116
  diff -u -r1.115 -r1.116
  --- http_request.c	2001/09/20 17:54:51	1.115
  +++ http_request.c	2001/10/02 21:13:41	1.116
  @@ -424,7 +424,6 @@
       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 */
  
  
  
  1.64      +2 -4      httpd-2.0/modules/http/mod_mime.c
  
  Index: mod_mime.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/modules/http/mod_mime.c,v
  retrieving revision 1.63
  retrieving revision 1.64
  diff -u -r1.63 -r1.64
  --- mod_mime.c	2001/09/08 05:50:12	1.63
  +++ mod_mime.c	2001/10/02 21:13:42	1.64
  @@ -754,12 +754,11 @@
                   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 @@
       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);
  
  
  
  1.46      +9 -3      httpd-2.0/modules/metadata/mod_mime_magic.c
  
  Index: mod_mime_magic.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/modules/metadata/mod_mime_magic.c,v
  retrieving revision 1.45
  retrieving revision 1.46
  diff -u -r1.45 -r1.46
  --- mod_mime_magic.c	2001/08/21 12:16:53	1.45
  +++ mod_mime_magic.c	2001/10/02 21:13:42	1.46
  @@ -2370,9 +2370,15 @@
   	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;
       }