You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by fi...@hyperreal.org on 1999/02/06 10:58:05 UTC
cvs commit: apache-1.3/src/modules/standard mod_negotiation.c
fielding 99/02/06 01:58:05
Modified: src CHANGES
src/modules/standard mod_negotiation.c
Log:
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
statements within mod_negotiation.
Submitted by: Koen Holtman
Reviewed by: Roy Fielding
Revision Changes Path
1.1234 +5 -0 apache-1.3/src/CHANGES
Index: CHANGES
===================================================================
RCS file: /home/cvs/apache-1.3/src/CHANGES,v
retrieving revision 1.1233
retrieving revision 1.1234
diff -u -r1.1233 -r1.1234
--- CHANGES 1999/02/06 08:51:24 1.1233
+++ CHANGES 1999/02/06 09:58:02 1.1234
@@ -1,5 +1,10 @@
Changes with Apache 1.3.5
+ *) 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
+ statements within mod_negotiation. [Koen Holtman]
+
*) Fixed a rare memory corruption possibility in mod_dir if the index
file is negotiable and no acceptable variant can be found.
[Dean Gaudet, Roy Fielding, Martin Kraemer]
1.93 +20 -17 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.92
retrieving revision 1.93
diff -u -r1.92 -r1.93
--- mod_negotiation.c 1999/01/03 12:04:38 1.92
+++ mod_negotiation.c 1999/02/06 09:58:04 1.93
@@ -585,7 +585,7 @@
*/
}
-#if NEG_DEBUG
+#ifdef NEG_DEBUG
fprintf(stderr, "dont_fiddle_headers=%d use_rvsa=%d ua_supports_trans=%d "
"send_alternates=%d, may_choose=%d\n",
neg->dont_fiddle_headers, neg->use_rvsa,
@@ -1776,7 +1776,7 @@
"mimeq=%1.3f langq=%1.3f charq=%1.3f encq=%1.3f "
"q=%1.5f definite=%d\n",
(variant->file_name ? variant->file_name : ""),
- (variant->mime_name ? variant->mime_name : ""),
+ (variant->mime_type ? variant->mime_type : ""),
(variant->content_languages
? ap_array_pstrcat(neg->pool, variant->content_languages, ',')
: ""),
@@ -1784,7 +1784,8 @@
variant->mime_type_quality,
variant->lang_quality,
variant->charset_quality,
- variant->encoding_qual q,
+ variant->encoding_quality,
+ q,
variant->definite);
#endif
@@ -1853,6 +1854,22 @@
* acceptable by type, charset, encoding or language.
*/
+#ifdef NEG_DEBUG
+ fprintf(stderr, "Variant: file=%s type=%s lang=%s sourceq=%1.3f "
+ "mimeq=%1.3f langq=%1.3f langidx=%d charq=%1.3f encq=%1.3f \n",
+ (variant->file_name ? variant->file_name : ""),
+ (variant->mime_type ? variant->mime_type : ""),
+ (variant->content_languages
+ ? ap_array_pstrcat(neg->pool, variant->content_languages, ',')
+ : ""),
+ variant->source_quality,
+ variant->mime_type_quality,
+ variant->lang_quality,
+ variant->lang_index,
+ variant->charset_quality,
+ variant->encoding_quality);
+#endif
+
if (variant->encoding_quality == 0.0f ||
variant->lang_quality == 0.0f ||
variant->source_quality == 0.0f ||
@@ -2437,7 +2454,6 @@
int alg_result; /* result of variant selection algorithm */
int res;
int j;
- int unencoded_variants = 0;
/* Decide if resource is transparently negotiable */
@@ -2465,20 +2481,7 @@
*/
if (strchr(variant->file_name, '/'))
neg->is_transparent = 0;
-
- if (!variant->content_encoding)
- unencoded_variants++;
}
-
- /* If there are less than 2 unencoded variants, we always
- * switch to server-driven negotiation, regardless of whether
- * we are contacted by a client capable of transparent
- * negotiation. We do this because our current TCN
- * implementation does not deal well with the case of having 0
- * or 1 unencoded variants.
- */
- if (unencoded_variants < 2)
- neg->is_transparent = 0;
}
if (neg->is_transparent) {