Re: Random languages for httpd.apache.org/docs (fwd)

2002-02-09 Thread Justin Erenkrantz

On Sat, Feb 09, 2002 at 08:11:45AM -0800, Brian Behlendorf wrote:
> 
> Heh, anyone want to check this out?

Yeah, I see it too.  Add:

ForceLanguagePriority Prefer Fallback

to daedalus's httpd.conf.  I added it via .htaccess to docs-2.0
in httpd.apache.org and it respected the LanguagePriority.

I'm trying to dig through mod_negotiation to see why it isn't
returning MultipleVariants or NoAcceptableVariants.

OtherBill?  -- justin




Re: Random languages for httpd.apache.org/docs (fwd)

2002-02-10 Thread Greg Ames

Justin Erenkrantz wrote:
> 
> On Sat, Feb 09, 2002 at 08:11:45AM -0800, Brian Behlendorf wrote:
> >
> > Heh, anyone want to check this out?
> 
> Yeah, I see it too.  Add:
> 
> ForceLanguagePriority Prefer Fallback
> 
> to daedalus's httpd.conf.  I added it via .htaccess to docs-2.0
> in httpd.apache.org and it respected the LanguagePriority

...so are we saying the config file suddenly went bad?  It's possible, but I
doubt it.  
 
Greg



Re: Random languages for httpd.apache.org/docs (fwd)

2002-02-10 Thread Greg Ames

Brian Behlendorf wrote:
> 
> Heh, anyone want to check this out?
> 
> Brian
> 
> -- Forwarded message --
> Date: Sat, 9 Feb 2002 05:05:58 -0600
> From: Adam Hupp <[EMAIL PROTECTED]>
> To: [EMAIL PROTECTED]
> Subject: Random languages for httpd.apache.org/docs
> 
> I get french for /docs, and german for /docs/mod/directives.html.

I got English for both, then reconfigured Netscape (Edit
preferences...Navigator...Languages) and removed English (the only language I
had).  Then I got Japanese for both.  Cute!

I'm guessing it's been doing this for ages, but most people have some language
configured in their browser, which explains why we haven't heard of this
before.  I'll check with 2_0_28 after I finish testing the JRE_1 tarball +
prefork patch.

Greg



Re: Random languages for httpd.apache.org/docs (fwd)

2002-02-10 Thread Joshua Slive


On Sun, 10 Feb 2002, Greg Ames wrote:

> Justin Erenkrantz wrote:
> >
> > On Sat, Feb 09, 2002 at 08:11:45AM -0800, Brian Behlendorf wrote:
> > >
> > > Heh, anyone want to check this out?
> >
> > Yeah, I see it too.  Add:
> >
> > ForceLanguagePriority Prefer Fallback
> >
> > to daedalus's httpd.conf.  I added it via .htaccess to docs-2.0
> > in httpd.apache.org and it respected the LanguagePriority
>
> ...so are we saying the config file suddenly went bad?  It's possible, but I
> doubt it.

The config files are wrong; they should have ForceLanguagePriority.

BUT... This does not explain the problem.  In the absence of
ForceLanguagePriority, apache should do the following:

1) If no Accept-Language: Use LanguagePriority.

2) If Accept-Language doesn't match with available language: Return "No
Acceptable Variant".

It shouldn't be returning Japanese in any case unless Japaenese is
preffered in the Accept-Language or by LanguagePriority.

So we shouldn't just patch httpd.conf.  We need to figure out what is
going wrong.

Joshua.




Re: Random languages for httpd.apache.org/docs (fwd)

2002-02-10 Thread Greg Ames

Greg Ames wrote:
> 
> Brian Behlendorf wrote:
> >
> > Heh, anyone want to check this out?
> >
> > Brian
> >
> > -- Forwarded message --
> > Date: Sat, 9 Feb 2002 05:05:58 -0600
> > From: Adam Hupp <[EMAIL PROTECTED]>
> > To: [EMAIL PROTECTED]
> > Subject: Random languages for httpd.apache.org/docs
> >
> > I get french for /docs, and german for /docs/mod/directives.html.
> 
> I got English for both, then reconfigured Netscape (Edit
> preferences...Navigator...Languages) and removed English (the only language I
> had).  Then I got Japanese for both.  Cute!
> 
> I'm guessing it's been doing this for ages

ummm, no.  2_0_28 returns English with no language configured in Netscape.  It
doesn't have ForceLanguagePriority in the config file either.

Greg



Re: Random languages for httpd.apache.org/docs (fwd)

2002-02-10 Thread Justin Erenkrantz

On Sun, Feb 10, 2002 at 12:02:18PM -0500, Joshua Slive wrote:
> The config files are wrong; they should have ForceLanguagePriority.

rbb and I agree that "ForceLanguagePriority Prefer Fallback" should
be the default.  It defaults to "None" right now.

OtherBill added this a few months ago (?) when he did some changes
to mod_negotiation.  He *did* add "Prefer Fallback" to the 
httpd-std.conf files, so it's obvious he intended this to be the
default.  No one updated daedalus to match.  As I tried to show,
just by adding "ForceLanguagePriority Prefer Fallback" to docs-2.0
fixes our problem.

> BUT... This does not explain the problem.  In the absence of
> ForceLanguagePriority, apache should do the following:

Well, taking a look at the code, I'm not entirely sure we're
doing the wrong thing.

I believe OtherBill was trying to ensure that we could never
return the "wrong" thing unless the admin told us otherwise.
Previously, we would return .html as the best language.  That's
a complete and total hack that we *must* get rid of.  It was the
wrong thing to do.

This is how I see it:

Prefer is used to avoid cases where we would send
MULTIPLE_CHOICES or we do not have enough information to
make a good determination about which language to use.  So, 
we'll use LanguagePriority to determine what is best.  (As
we'll see in a second, otherwise, we'll use C-L to determine
the best variant.)

Fallback is used when we have no acceptable variants listed
that match and would return NOT_ACCEPTABLE.  We'll try to
have a "fallback" choice to prevent that from occurring.
Again, we'll use LanguagePriority to determine the "best"
choice.

> 1) If no Accept-Language: Use LanguagePriority.

In this case, this is only used when "ForceLanguagePriority" is
set to Prefer.  Look at mod_negotiation.c:set_language_quality().
On browsers that don't send Accept-Language headers, we can't
use any heuristics, so we avoid making any determination as to
the quality of the variant.  However, we have a failsafe here:
"Prefer" in ForceLanguagePriority.

If "ForceLanguagePriority" is set to Prefer and we haven't computed
its language priority (and in the case of no Accept-Language we
definitely haven't set lang_index), we'll go through and compute
lang_index based on LanguagePriority listed in httpd.conf.

When we go through all variants in best_match() and call
is_variant_better(), one of the factors is lang_index.  However,
if Prefer isn't set and we didn't receive Accept-Language, lang_index
is -1 for *all* variants.  So, they would all match.  And, indeed,
with our manuals, that is really the only distinction we have
available when we don't have an Accept-Language.  Therefore, the
determining factor once again is content-length.  And, french has
the smallest size of all the docs:

jerenkrantz@daedalus% ls -l /www/httpd.apache.org/docs/index.html.*
-rw-rw-r--  1 slive   httpd  9266 Dec  2 11:46 index.html.en
-rw-r--r--  1 rbowen  httpd  8603 Oct  7 18:41 index.html.fr
-rw-r--r--  1 rbowen  httpd   156 Oct  7 18:41 index.html.html
-rw-rw-r--  1 slive   httpd  9504 Dec 30 08:07 index.html.ja.jis

(Notice our friend .html.html which has been relegated to outcast.)

jerenkrantz@daedalus% ls -l /www/httpd.apache.org/docs-2.0/index.html*
-rw-rw-r--  1 slive httpd  9334 Dec  3 10:38 index.html.en
-rw-rw-r--  1 jwoolley  httpd  8223 Sep 22 17:29 index.html.fr
-rw-rw-r--  1 slive httpd  5614 Dec 13 13:42 index.html.ja.jis

(See why Japanese would be returned for Apache 2.0 docs, but I
added FLP to the .htaccess file on daedalus, so we'll respect
LangPriority.)

> 2) If Accept-Language doesn't match with available language: Return "No
> Acceptable Variant".

I believe this could occur if Accept-Language is sent.  In the
cases we're seeing, that's not the case as no Accept-Language is
sent.  And, indeed, this is what Fallback is for.  Fallback should
deal with the case that we don't want to return HTTP_NOT_ACCEPTABLE
if their Accept-Language doesn't match.

> So we shouldn't just patch httpd.conf.  We need to figure out what is
> going wrong.

I believe nothing is wrong.

I believe it is working as intended.  Fix the config file, and
move on.  I will attempt to commit a change that makes PREFER
and FALLBACK the default for ForceLangPriority in the code, but
I'm not sure when I'll be able to commit that.  OtherBill may
beat me to that.  (I believe he is taking a well-deserved
vacation this weekend.)  -- justin




RE: Random languages for httpd.apache.org/docs (fwd)

2002-02-10 Thread Ryan Bloom

> Justin Erenkrantz wrote:
> >
> > On Sat, Feb 09, 2002 at 08:11:45AM -0800, Brian Behlendorf wrote:
> > >
> > > Heh, anyone want to check this out?
> >
> > Yeah, I see it too.  Add:
> >
> > ForceLanguagePriority Prefer Fallback
> >
> > to daedalus's httpd.conf.  I added it via .htaccess to docs-2.0
> > in httpd.apache.org and it respected the LanguagePriority
> 
> ...so are we saying the config file suddenly went bad?  It's possible,
but
> I
> doubt it.

OtherBill committed code that changed how mod_negotiations works, so
yes, the config file went bad when we bumped to this version of Apache.
As it happens, this is also a bug in the code, because the default is
wrong, but the simple fix right now is to fix the config file.

Ryan





Re: Random languages for httpd.apache.org/docs (fwd)

2002-02-10 Thread Justin Erenkrantz

On Sun, Feb 10, 2002 at 02:45:41PM -0500, Greg Ames wrote:
> ummm, no.  2_0_28 returns English with no language configured in Netscape.  It
> doesn't have ForceLanguagePriority in the config file either.

wrowe added FLP in revision 1.86 of mod_negotiation:

revision 1.86
date: 2001/12/30 04:14:20;  author: wrowe;  state: Exp;  lines: +77 -73

  Introduce the ForceLanguagePriority options;

  Prefer will circumvent a Multiple Choices by electing the first matching
  language from the LanaguagePriority list.

  Fallback will circumvent a None Acceptable by electing the first
  language found from the LanaguagePriority list.

  This breaks [expectedly] the negotiation tests.  They need review.
  My test results will be posted to dev.

2.0.28 has revision 1.84, so this is expected.  And, I think that
2.0.28 might be serving .html.html.  =)

I believe this change makes our behavior better and makes us more
configurable.  -- justin




RE: Random languages for httpd.apache.org/docs (fwd)

2002-02-10 Thread Ryan Bloom

> > So we shouldn't just patch httpd.conf.  We need to figure out what
is
> > going wrong.
> 
> I believe nothing is wrong.
> 
> I believe it is working as intended.  Fix the config file, and
> move on.  I will attempt to commit a change that makes PREFER
> and FALLBACK the default for ForceLangPriority in the code, but
> I'm not sure when I'll be able to commit that.  OtherBill may
> beat me to that.  (I believe he is taking a well-deserved
> vacation this weekend.)  -- justin

I agree 100% with everything Justin said.  The only bug in the code is
that we have a default in the standard config file that doesn't match
the default in the code.  My boss keeps trying to convince me that it is
a bug if the software doesn't "just work" with an empty config file.
While I'm not sure I am at that point, I do believe that it is a bug if
we have a default in the standard config that isn't a default in the
code itself.

Ryan





RE: Random languages for httpd.apache.org/docs (fwd)

2002-02-10 Thread Joshua Slive


On Sun, 10 Feb 2002, Ryan Bloom wrote:

> I agree 100% with everything Justin said.  The only bug in the code is
> that we have a default in the standard config file that doesn't match
> the default in the code.  My boss keeps trying to convince me that it
> is a bug if the software doesn't "just work" with an empty config
> file. While I'm not sure I am at that point, I do believe that it is a
> bug if we have a default in the standard config that isn't a default
> in the code itself. Ryan

I meant to comment on this point too.  The reason that the default for
ForceLanguagePriority is "none" is that this gives the behavior closest to
1.3 and closest to the intentions of the HTTP/1.1 spec.  (Although on the
latter front, I'm not too sure.)  I agree that it is confusing when the
default config differs from the server default, but this is far from the
only case for that.

On the other hand, I won't object if you want to change the default.
However, I still believe (strongly) that the behavior with
"ForceLanguagePriority none" is wrong in the case of no Accept-Language
and should be fixed.

Joshua.




Re: Random languages for httpd.apache.org/docs (fwd)

2002-02-10 Thread William A. Rowe, Jr.

From: "Joshua Slive" <[EMAIL PROTECTED]>
Sent: Sunday, February 10, 2002 11:02 AM


> On Sun, 10 Feb 2002, Greg Ames wrote:
> 
> > ...so are we saying the config file suddenly went bad?  It's possible, but I
> > doubt it.
> 
> The config files are wrong; they should have ForceLanguagePriority.
> 
> BUT... This does not explain the problem.  In the absence of
> ForceLanguagePriority, apache should do the following:
> 
> 1) If no Accept-Language: Use LanguagePriority.

Bingo.  It's been so long since I hadn't looked at this; I've had brain 
freeze.  [20 hour days with 4 hours rest haven't helped either - revisiting 
some priorities over this weekend I expect will help - at least help me.]

That is not, in fact, what ForceLanguagePriority NONE should accomplish.
I got stuck figuring out the implementation - the others worked so I had
proceeded up to this issue.

If the express no language preference, and we have ten available languages,
and the administrator configures ForceLanguagePriority None - the available
variants aught to be displayed.

[It would be _really_ cool to have a HTTP_MULTIPLE_CHOICES.html that provides
a single comment on how to toggle the language list for some common browsers :)


> 2) If Accept-Language doesn't match with available language: Return "No
> Acceptable Variant".

With None you are correct.


Let me point out we can assign any reasonable default for the ForceLanguagePriority
options until the admin overrides them.  ForceLanguagePriority Default  would be
one good start.




Re: Random languages for httpd.apache.org/docs (fwd)

2002-02-11 Thread Joshua Slive


On Mon, 11 Feb 2002, William A. Rowe, Jr. wrote:
> 1.3 sent the admin's choice.  2.0 should be able to do either, but default to
> sending the admin's choice.
>
> Make sense?

OK.  That's fine with me.

Joshua.




Re: Random languages for httpd.apache.org/docs (fwd)

2002-02-12 Thread Greg Ames

Adam,

There was a code change related to a new httpd 2.0 config directive,
ForceLanguagePriority, that caused the strange language behavior you noticed. 
It seems the new directive doesn't have an appropriate default setting.  I have
temporarily changed apache.org's config file to compensate, so you should see
English once again when your browser doesn't have another language configured.

Thanks for reporting this problem, and our apologies for any inconvenience.
Greg Ames
---
Brian Behlendorf wrote:
> 
> Heh, anyone want to check this out?
> 
> Brian
> 
> -- Forwarded message --
> Date: Sat, 9 Feb 2002 05:05:58 -0600
> From: Adam Hupp <[EMAIL PROTECTED]>
> To: [EMAIL PROTECTED]
> Subject: Random languages for httpd.apache.org/docs
> 
> I get french for /docs, and german for /docs/mod/directives.html.
> 
> -Adam