Return-Path: Delivered-To: apache-cvs-archive@hyperreal.org Received: (qmail 22413 invoked by uid 6000); 6 Feb 1999 11:00:22 -0000 Received: (qmail 22398 invoked by alias); 6 Feb 1999 11:00:20 -0000 Delivered-To: apache-1.3-cvs@hyperreal.org Received: (qmail 22396 invoked by uid 82); 6 Feb 1999 11:00:19 -0000 Date: 6 Feb 1999 11:00:19 -0000 Message-ID: <19990206110019.22395.qmail@hyperreal.org> From: fielding@hyperreal.org To: apache-1.3-cvs@hyperreal.org Subject: cvs commit: apache-1.3/src/modules/standard mod_negotiation.c Sender: apache-cvs-owner@apache.org Precedence: bulk Reply-To: new-httpd@apache.org fielding 99/02/06 03:00:18 Modified: src CHANGES src/modules/standard mod_negotiation.c Log: Explain why we do not round the TCN quality calculation to 5 decimal places, unlike RFC 2296, because the calculation might need 12 decimal places to get the right result. Revision Changes Path 1.1235 +4 -0 apache-1.3/src/CHANGES Index: CHANGES =================================================================== RCS file: /home/cvs/apache-1.3/src/CHANGES,v retrieving revision 1.1234 retrieving revision 1.1235 diff -u -r1.1234 -r1.1235 --- CHANGES 1999/02/06 09:58:02 1.1234 +++ CHANGES 1999/02/06 11:00:09 1.1235 @@ -1,5 +1,9 @@ Changes with Apache 1.3.5 + *) Do not round the TCN quality calculation to 5 decimal places, + unlike RFC 2296, because the calculation might need 12 decimal places + to get the right result. [Roy Fielding] + *) Remove unused code to disable transparent negotiation when negotiating on encoding only, as we now handle encoding too (though this is nonstandard for TCN), and fix bugs in debugging 1.94 +8 -7 apache-1.3/src/modules/standard/mod_negotiation.c Index: mod_negotiation.c =================================================================== RCS file: /home/cvs/apache-1.3/src/modules/standard/mod_negotiation.c,v retrieving revision 1.93 retrieving revision 1.94 diff -u -r1.93 -r1.94 --- mod_negotiation.c 1999/02/06 09:58:04 1.93 +++ mod_negotiation.c 1999/02/06 11:00:15 1.94 @@ -1763,13 +1763,14 @@ variant->charset_quality * variant->lang_quality; - /* Make sure that variants with a very low nonzero q value - * do not get rounded down to 0 + /* RFC 2296 calls for the result to be rounded to 5 decimal places, + * but we don't do that because it serves no useful purpose other + * than to ensure that a remote algorithm operates on the same + * precision as ours. That is silly, since what we obviously want + * is for the algorithm to operate on the best available precision + * regardless of who runs it. Since the above calculation may + * result in significant variance at 1e-12, rounding would be bogus. */ - if (q <= 0.0f) - q = 0.0f; - else if (q < 0.00001f) - q = 0.00001f; #ifdef NEG_DEBUG fprintf(stderr, "Variant: file=%s type=%s lang=%s sourceq=%1.3f " @@ -1789,7 +1790,7 @@ variant->definite); #endif - if (q == 0.0f) { + if (q <= 0.0f) { return 0; } if (q > bestq) {