You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by ji...@hyperreal.org on 2000/02/03 15:22:39 UTC
cvs commit: apache-1.3/src/main http_core.c
jim 00/02/03 06:22:36
Modified: htdocs/manual/mod core.html directives.html
src CHANGES
src/main http_core.c
Log:
Streamline the AddDefaultCharset directive. Now this one directive
controls the entire 'charset' specification setup. If there is
heartburn, I have no trouble with backing this out, but it makes
live easier for those not using the "default" charset, and reduces
directive bloat a bit :)
Reviewed by: Martin
Revision Changes Path
1.164 +9 -25 apache-1.3/htdocs/manual/mod/core.html
Index: core.html
===================================================================
RCS file: /export/home/cvs/apache-1.3/htdocs/manual/mod/core.html,v
retrieving revision 1.163
retrieving revision 1.164
diff -u -r1.163 -r1.164
--- core.html 2000/02/02 20:43:11 1.163
+++ core.html 2000/02/03 14:22:25 1.164
@@ -24,7 +24,6 @@
<LI><A HREF="#accessconfig">AccessConfig</A>
<LI><A HREF="#accessfilename">AccessFileName</A>
<LI><A HREF="#adddefaultcharset">AddDefaultCharset</A>
-<LI><A HREF="#adddefaultcharsetname">AddDefaultCharsetName</A>
<LI><A HREF="#addmodule">AddModule</A>
<LI><A HREF="#allowoverride">AllowOverride</A>
<LI><A HREF="#authname">AuthName</A>
@@ -167,38 +166,23 @@
<H2><A NAME="adddefaultcharset">AddDefaultCharset directive</A></H2>
<A HREF="directive-dict.html#Syntax" REL="Help"><STRONG>Syntax:</STRONG></A>
-AddDefaultCharset <EM>on / off</EM><BR>
+AddDefaultCharset <EM>None / Default / charset</EM><BR>
<A HREF="directive-dict.html#Context" REL="Help" ><STRONG>Context:</STRONG></A>
all<BR>
<A HREF="directive-dict.html#Status" REL="Help" ><STRONG>Status:</STRONG></A>
core<BR>
<A HREF="directive-dict.html#Default" REL="Help"><STRONG>Default:</STRONG></A>
-<CODE>AddDefaultCharset off</CODE><BR>
+<CODE>AddDefaultCharset None</CODE><BR>
<A HREF="directive-dict.html#Compatibility" REL="Help"><STRONG>Compatibility:
-</STRONG></A> AddDefaultCharset is only available in Apache 1.3.12 and later<P>
-If enabled, any response that does not have any parameter on the content
-type in the HTTP headers will have a charset parameter added specifying
-the character set the client should use for the document. This will
-override any character set specified in the body of the document via a
-<CODE>META</CODE> tag. The character set added is specified by the
-<CODE>AddDefaultCharsetName</CODE> directive.
-<P><HR>
-
-<H2><A NAME="adddefaultcharsetname">AddDefaultCharsetName directive</A></H2>
-<A HREF="directive-dict.html#Syntax" REL="Help"><STRONG>Syntax:</STRONG></A>
-AddDefaultCharsetName <EM>charset</EM><BR>
-<A HREF="directive-dict.html#Context" REL="Help" ><STRONG>Context:</STRONG></A>
-all<BR>
-<A HREF="directive-dict.html#Status" REL="Help" ><STRONG>Status:</STRONG></A>
-core<BR>
-<A HREF="directive-dict.html#Default" REL="Help"><STRONG>Default:</STRONG></A>
-<CODE>AddDefaultCharsetName iso-8859-1</CODE><BR>
-<A HREF="directive-dict.html#Compatibility" REL="Help"><STRONG>Compatibility:
-</STRONG></A> AddDefaultCharsetName is only available in Apache 1.3.12 and
+</STRONG></A> AddDefaultCharset is only available in Apache 1.3.12 and
later<P>
This directive specifies the name of the character set that will be added
-if the <A HREF="#adddefaultcharset">AddDefaultCharset</A> directive is
-enabled.
+to any response that does not have any parameter on the content
+type in the HTTP headers. This will override any character set specified
+in the body of the document via a <CODE>META</CODE> tag. A setting
+of <CODE>AddDefaultCharset None</CODE> disables this functionality.
+<CODE>AddDefaultCharset Default</CODE> is the exact same as
+<code>AddDefaultCharsetName iso-8859-1</code>.
<P><HR>
<H2><A NAME="addmodule">AddModule directive</A></H2>
1.63 +0 -1 apache-1.3/htdocs/manual/mod/directives.html
Index: directives.html
===================================================================
RCS file: /export/home/cvs/apache-1.3/htdocs/manual/mod/directives.html,v
retrieving revision 1.62
retrieving revision 1.63
diff -u -r1.62 -r1.63
--- directives.html 2000/02/03 11:54:28 1.62
+++ directives.html 2000/02/03 14:22:26 1.63
@@ -32,7 +32,6 @@
<LI><A HREF="mod_autoindex.html#addaltbytype">AddAltByType</A>
<LI><A HREF="mod_mime.html#addcharset">AddCharset</A>
<LI><A HREF="core.html#adddefaultcharset">AddDefaultCharset</A>
-<LI><A HREF="core.html#adddefaultcharsetname">AddDefaultCharsetName</A>
<LI><A HREF="mod_autoindex.html#adddescription">AddDescription</A>
<LI><A HREF="mod_mime.html#addencoding">AddEncoding</A>
<LI><A HREF="mod_mime.html#addhandler">AddHandler</A>
1.1505 +3 -4 apache-1.3/src/CHANGES
Index: CHANGES
===================================================================
RCS file: /export/home/cvs/apache-1.3/src/CHANGES,v
retrieving revision 1.1504
retrieving revision 1.1505
diff -u -r1.1504 -r1.1505
--- CHANGES 2000/02/02 20:43:28 1.1504
+++ CHANGES 2000/02/03 14:22:28 1.1505
@@ -4,10 +4,9 @@
ap_send_error_response(), such as the default 404 page.
[Marc Slemko]
- *) Add the AddDefaultCharset and AddDefaultCharsetName directives.
- These allow you to tell Apache to specify the given character
- set on any document that does not have one explicitly specified in
- the headers. [Marc Slemko]
+ *) Add the AddDefaultCharset directive. This allows you to specify
+ the given character set on any document that does not have one
+ explicitly specified in the headers. [Marc Slemko, Jim Jagielski]
*) Properly escape various messages output to the client from a number
of modules and places in the core code. [Marc Slemko]
1.279 +12 -16 apache-1.3/src/main/http_core.c
Index: http_core.c
===================================================================
RCS file: /export/home/cvs/apache-1.3/src/main/http_core.c,v
retrieving revision 1.278
retrieving revision 1.279
diff -u -r1.278 -r1.279
--- http_core.c 2000/02/02 20:43:46 1.278
+++ http_core.c 2000/02/03 14:22:33 1.279
@@ -1047,24 +1047,22 @@
#endif /*GPROF*/
static const char *set_add_default_charset(cmd_parms *cmd,
- core_dir_config *d, int arg)
-{
- const char *err = ap_check_cmd_context(cmd, NOT_IN_LIMIT);
- if (err != NULL) {
- return err;
- }
- d->add_default_charset = arg != 0;
- return NULL;
-}
-
-static const char *set_add_default_charset_name(cmd_parms *cmd,
core_dir_config *d, char *arg)
{
const char *err = ap_check_cmd_context(cmd, NOT_IN_LIMIT);
if (err != NULL) {
return err;
+ }
+ if (!strcasecmp(arg, "None"))
+ d->add_default_charset = 0;
+ else if (!strcasecmp(arg, "Default")) {
+ d->add_default_charset = 1;
+ d->add_default_charset_name = DEFAULT_ADD_DEFAULT_CHARSET_NAME;
+ }
+ else {
+ d->add_default_charset = 1;
+ d->add_default_charset_name = arg;
}
- d->add_default_charset_name = arg;
return NULL;
}
@@ -2819,10 +2817,8 @@
{ "GprofDir", set_gprof_dir, NULL, RSRC_CONF, TAKE1,
"Directory to plop gmon.out files" },
#endif
-{ "AddDefaultCharset", set_add_default_charset, NULL, OR_FILEINFO, FLAG,
- "whether or not to add a default charset to any Content-Type without one" },
-{ "AddDefaultCharsetName", set_add_default_charset_name, NULL, OR_FILEINFO,
- TAKE1, "The name of the charset to add if AddDefaultCharset is enabled" },
+{ "AddDefaultCharset", set_add_default_charset, NULL, OR_FILEINFO,
+ TAKE1, "The name of the default charset to add to any Content-Type without one or 'None' to disable" },
/* Old resource config file commands */
Re: cvs commit: apache-1.3/src/main http_core.c
Posted by Daniel Lange <DL...@bigfoot.com>.
At 19:03 03.02.00 , you wrote:
> >
> > How about adding
> > AddDefaultCharset iso-8859-1
> > as a standard line to conf/http.conf(.default|-dist) to people either
> > just have it (new install) or only need to copy it (upgrade).
>
>That doesn't really address the issue. We do not want it to default to
>being enabled and having it default to being enabled would be very very
>very broken behaviour for a webserver and would cause a lot of people a
>lot of pain.
Put a # in front of it.
Daniel
Re: cvs commit: apache-1.3/src/main http_core.c
Posted by Marc Slemko <ma...@znep.com>.
On Thu, 3 Feb 2000, Daniel Lange wrote:
> At 17:24 03.02.00 , you wrote:
> >I can see the confusion with 'AddDefaultCharset Default' not being
> >the same as the "default" value when AddDefaultCharset isn't
> >set... Basically, I was looking for an easy way to enable it and
> >default it without the user having to type the iso-xxxx stuff.
> >But AddDefaultCharset On looked too binary.
...right, which is one of the reasons I used two directives in the first
place. That, plus it simply seems cleaner not overloading one directive
to have two different functions, when the code makes it obvious that there
are two different things going on.
>
> How about adding
> AddDefaultCharset iso-8859-1
> as a standard line to conf/http.conf(.default|-dist) to people either
> just have it (new install) or only need to copy it (upgrade).
That doesn't really address the issue. We do not want it to default to
being enabled and having it default to being enabled would be very very
very broken behaviour for a webserver and would cause a lot of people a
lot of pain.
Re: cvs commit: apache-1.3/src/main http_core.c
Posted by Daniel Lange <DL...@bigfoot.com>.
At 17:24 03.02.00 , you wrote:
>I can see the confusion with 'AddDefaultCharset Default' not being
>the same as the "default" value when AddDefaultCharset isn't
>set... Basically, I was looking for an easy way to enable it and
>default it without the user having to type the iso-xxxx stuff.
>But AddDefaultCharset On looked too binary.
How about adding
AddDefaultCharset iso-8859-1
as a standard line to conf/http.conf(.default|-dist) to people either
just have it (new install) or only need to copy it (upgrade).
Daniel
Re: cvs commit: apache-1.3/src/main http_core.c
Posted by rb...@apache.org.
Can we get this ported to 2.0 please. :-)
Ryan
On Thu, 3 Feb 2000, Marc Slemko wrote:
> On 3 Feb 2000 jim@hyperreal.org wrote:
>
> > jim 00/02/03 06:22:36
> >
> > Modified: htdocs/manual/mod core.html directives.html
> > src CHANGES
> > src/main http_core.c
> > Log:
> > Streamline the AddDefaultCharset directive. Now this one directive
> > controls the entire 'charset' specification setup. If there is
> > heartburn, I have no trouble with backing this out, but it makes
> > live easier for those not using the "default" charset, and reduces
> > directive bloat a bit :)
Come to the first official Apache Software Foundation
Conference!!! <http://ApacheCon.Com/>
_______________________________________________________________________________
Ryan Bloom rbb@ntrnet.net
2121 Stonehenge Dr. Apt #3
Raleigh, NC 27615 Ryan Bloom -- thinker, adventurer, artist,
writer, but mostly, friend.
-------------------------------------------------------------------------------
Re: cvs commit: apache-1.3/src/main http_core.c
Posted by Marc Slemko <ma...@znep.com>.
On 3 Feb 2000 jim@hyperreal.org wrote:
> jim 00/02/03 06:22:36
>
> Modified: htdocs/manual/mod core.html directives.html
> src CHANGES
> src/main http_core.c
> Log:
> Streamline the AddDefaultCharset directive. Now this one directive
> controls the entire 'charset' specification setup. If there is
> heartburn, I have no trouble with backing this out, but it makes
> live easier for those not using the "default" charset, and reduces
> directive bloat a bit :)
Is the use of "AddDefaultCharset default" perhaps a bit confusing
because it refers to two different defaults? The first one is a
default if there is no charset, the second is a default charset.
Plus an implict third that it could refer to, which is the default
setting of the directive?
(I'm not saying back it out; if I wanted to -1 it I would have)