httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Paul Sutton <p...@ukweb.com>
Subject [PATCH] revenge of PR#94
Date Wed, 09 Jul 1997 20:36:23 GMT
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' ||


Mime
View raw message