You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Paul Sutton <pa...@ukweb.com> on 1997/07/09 22:36:23 UTC

[PATCH] revenge of PR#94

The PR#94 bug in mod_negotiation should have been fixed in 1.2.1.  But my
patch contained a slight flaw which I'm amazed I didn't spot because I'm
sure I tested exactly the situation which makes it not work (the one from
PR#94 itself). And the bug is competely obvious from the code. Doh. But it
doesn't work, and the following patch really should fix it... 

(The problem is that Apache does not pick the smallest equal variant
unless all variants have charsets, and also picks the last listed equal
variant instead of the first). 

I've sent this patch to the submitter of PR#94 - if he confirms it works
this should be committed to HEAD and 1_2_X.

//pcs

*** ../src2/mod_negotiation.c	Wed Jul  9 15:33:07 1997
--- ./mod_negotiation.c	Wed Jul  9 20:52:51 1997
***************
*** 1443,1448 ****
--- 1443,1449 ----
             the same charset quality, then we prefer this variant */
          if (variant->charset_quality == best->charset_quality &&
              (variant->content_charset != NULL &&
+              *variant->content_charset != '\0' &&
               strcmp(variant->content_charset, "iso-8859-1") != 0) &&
              (best->content_charset == NULL ||
               *best->content_charset == '\0' ||
***************
*** 1545,1550 ****
--- 1546,1552 ----
         the same charset quality, then we prefer this variant */
      if (variant->charset_quality > best->charset_quality ||
  	((variant->content_charset != NULL &&
+           *variant->content_charset != '\0' &&
  	  strcmp(variant->content_charset, "iso-8859-1") != 0) &&
  	 (best->content_charset == NULL ||
  	  *best->content_charset == '\0' ||


Re: [PATCH] revenge of PR#94

Posted by Alexei Kosut <ak...@organic.com>.
On Wed, 9 Jul 1997, Paul Sutton wrote:

> The PR#94 bug in mod_negotiation should have been fixed in 1.2.1.  But my
> patch contained a slight flaw which I'm amazed I didn't spot because I'm
> sure I tested exactly the situation which makes it not work (the one from
> PR#94 itself). And the bug is competely obvious from the code. Doh. But it
> doesn't work, and the following patch really should fix it... 

+1

-- Alexei Kosut <ak...@organic.com>