pcs 96/10/28 08:05:49
Modified: src http_protocol.c httpd.h mod_mime.c Log: Reviewed By: Brian Behlendorf, Dirk vanGulik Allow each resource to have more than one content-language associated with it. Update mod_mime to allow files to have multiple language extensions (eg foo.en.fr.html). Add new request_rec element 'content_languages' to hold an array of the languages, and deprecate use of 'content_language'. Revision Changes Path 1.66 +10 -1 apache/src/http_protocol.c Index: http_protocol.c =================================================================== RCS file: /export/home/cvs/apache/src/http_protocol.c,v retrieving revision 1.65 retrieving revision 1.66 diff -C3 -r1.65 -r1.66 *** http_protocol.c 1996/10/23 18:13:54 1.65 --- http_protocol.c 1996/10/28 16:05:45 1.66 *************** *** 1011,1017 **** if (r->content_encoding) bvputs(fd,"Content-Encoding: ", r->content_encoding, "\015\012", NULL); ! if (r->content_language) bvputs(fd,"Content-Language: ", r->content_language, "\015\012", NULL); /* We now worry about this here */ --- 1011,1026 ---- if (r->content_encoding) bvputs(fd,"Content-Encoding: ", r->content_encoding, "\015\012", NULL); ! if (r->content_languages && r->content_languages->nelts) { ! int i; ! bputs("Content-Langauge: ", fd); ! for (i = 0; i < r->content_languages->nelts; ++i) { ! char *lang = ((char**)(r->content_languages->elts))[i]; ! bvputs(fd, i ? ", " : "", lang, NULL); ! } ! bputs("\015\012", fd); ! } ! else if (r->content_language) bvputs(fd,"Content-Language: ", r->content_language, "\015\012", NULL); /* We now worry about this here */ 1.58 +2 -1 apache/src/httpd.h Index: httpd.h =================================================================== RCS file: /export/home/cvs/apache/src/httpd.h,v retrieving revision 1.57 retrieving revision 1.58 diff -C3 -r1.57 -r1.58 *** httpd.h 1996/10/20 20:45:52 1.57 --- httpd.h 1996/10/28 16:05:46 1.58 *************** *** 451,457 **** char *handler; /* What we *really* dispatch on */ char *content_encoding; ! char *content_language; int no_cache; int no_local_copy; --- 451,458 ---- char *handler; /* What we *really* dispatch on */ char *content_encoding; ! char *content_language; /* for back-compat. only -- do not use */ ! array_header *content_languages; /* array of (char*) */ int no_cache; int no_local_copy; 1.13 +8 -1 apache/src/mod_mime.c Index: mod_mime.c =================================================================== RCS file: /export/home/cvs/apache/src/mod_mime.c,v retrieving revision 1.12 retrieving revision 1.13 diff -C3 -r1.12 -r1.13 *** mod_mime.c 1996/10/20 18:03:36 1.12 --- mod_mime.c 1996/10/28 16:05:47 1.13 *************** *** 250,256 **** /* Check for Content-Language */ if ((type = table_get (conf->language_types, ext))) { ! r->content_language = type; found = 1; } --- 250,262 ---- /* Check for Content-Language */ if ((type = table_get (conf->language_types, ext))) { ! char **new; ! ! r->content_language = type; /* back compat. only */ ! if (!r->content_languages) ! r->content_languages = make_array (r->pool, 2, sizeof(char*)); ! new = (char **)push_array (r->content_languages); ! *new = type; found = 1; } *************** *** 278,283 **** --- 284,290 ---- if (!found) { r->content_type = NULL; r->content_language = NULL; + r->content_languages = NULL; r->content_encoding = NULL; r->handler = orighandler; }