fielding 99/02/06 06:36:27
Modified: src CHANGES
src/modules/standard mod_negotiation.c
Log:
Fix ordering of language variants for the case where the traditional
negotiation algorithm is being used with multiple language variants
and no Accept-Language is given.
PR: 3299, 3688
Submitted by: James Treacy <[EMAIL PROTECTED]>
Reviewed by: Roy Fielding, Koen Holtman
Revision Changes Path
1.1237 +4 -0 apache-1.3/src/CHANGES
Index: CHANGES
===================================================================
RCS file: /home/cvs/apache-1.3/src/CHANGES,v
retrieving revision 1.1236
retrieving revision 1.1237
diff -u -r1.1236 -r1.1237
--- CHANGES 1999/02/06 11:58:43 1.1236
+++ CHANGES 1999/02/06 14:36:25 1.1237
@@ -1,5 +1,9 @@
Changes with Apache 1.3.5
+ *) Fix ordering of language variants for the case where the traditional
+ negotiation algorithm is being used with multiple language variants
+ and no Accept-Language. [James Treacy <[EMAIL PROTECTED]>] PR#3299, 3688
+
*) 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]
1.96 +4 -8 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.95
retrieving revision 1.96
diff -u -r1.95 -r1.96
--- mod_negotiation.c 1999/02/06 11:58:45 1.95
+++ mod_negotiation.c 1999/02/06 14:36:27 1.96
@@ -1884,17 +1884,13 @@
return 1;
}
- /* if language qualities were equal, try the LanguagePriority
- * stuff
- */
- /* XXX: TODO: there is a slight discrepancy between how this
- * behaves and how it described in the documentation
- */
- if (best->lang_index != -1 && variant->lang_index > best->lang_index) {
+ /* if language qualities were equal, try the LanguagePriority stuff */
+ if (best->lang_index != -1 &&
+ (variant->lang_index == -1 || variant->lang_index >
best->lang_index)) {
return 0;
}
if (variant->lang_index != -1 &&
- (variant->lang_index < best->lang_index || best->lang_index == -1)) {
+ (best->lang_index == -1 || variant->lang_index < best->lang_index)) {
*p_bestq = q;
return 1;
}