You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Ben Laurie <be...@gonzo.ben.algroup.co.uk> on 1996/07/19 16:42:44 UTC
Comprehension failure
I've been looking at this bit of code (from mod_negotiation.c) and I'm puzzled:
if (q > best_quality
|| (q == best_quality
&& ((variant->mime_stars > best->mime_stars)
|| (variant->lang_index < best->lang_index
|| (variant->lang_index == best->lang_index
&& ((levcmp = level_cmp (variant, best)) == 1
|| (levcmp == 0
&& !strcmp (variant->type_name,
best->type_name)
&& (find_content_length(neg, variant)
<
find_content_length(neg, best)))))))))
{
best = variant;
best_quality = q;
}
It looks to me like content lengths are only compared if the type names
match. But would we expect to ever get two variants with the same type name?
Enlightenment, please!
Cheers,
Ben.
--
Ben Laurie Phone: +44 (181) 994 6435
Freelance Consultant and Fax: +44 (181) 994 6472
Technical Director Email: ben@algroup.co.uk
A.L. Digital Ltd, URL: http://www.algroup.co.uk
London, England. Apache Group member (http://www.apache.org)
Re: Comprehension failure
Posted by Alexei Kosut <ak...@organic.com>.
On Fri, 19 Jul 1996, Ben Laurie wrote:
> I've been looking at this bit of code (from mod_negotiation.c) and I'm puzzled:
[...]
> It looks to me like content lengths are only compared if the type names
> match. But would we expect to ever get two variants with the same type name?
Sure. "foo.html" vs. "foo.htm", for example.
-- Alexei Kosut <ak...@organic.com> The Apache HTTP Server
http://www.nueva.pvt.k12.ca.us/~akosut/ http://www.apache.org/