Good stuff. And a usefull extra function in the API as well.
Dw
On 28 Jul 1999 [EMAIL PROTECTED] wrote:
coar99/07/28 10:37:22
Modified:.STATUS
src CHANGES
src/include alloc.h
src/main alloc.c
src/modules/standard mod_headers.c mod_negotiation.c
mod_rewrite.c
src/support httpd.exp
Log:
Treat the Vary response header field specially; change the
modules that touch it to use a new routine that only adds a
token if it isn't already present. O(n^2) behaviour as
Dean points out, but absent set/atom operations it seems
a reasonable stopgap for 1.3.7.
PR: 4118 (previously closed with 'use force-no-vary')
Reviewed by:Ken Coar
Revision ChangesPath
1.727 +1 -8 apache-1.3/STATUS
Index: STATUS
===
RCS file: /home/cvs/apache-1.3/STATUS,v
retrieving revision 1.726
retrieving revision 1.727
diff -u -r1.726 -r1.727
--- STATUS 1999/07/28 14:06:20 1.726
+++ STATUS 1999/07/28 17:37:05 1.727
@@ -1,5 +1,5 @@
1.3 STATUS:
- Last modified at [$Date: 1999/07/28 14:06:20 $]
+ Last modified at [$Date: 1999/07/28 17:37:05 $]
Release:
@@ -67,13 +67,6 @@
RELEASE SHOWSTOPPERS:
-* The Vary header field stuff is still broken (multiple
- entries occur, etc.). The result is that some browsers (AFAIK at
least
- MSIE) are horribly confused by the responses.
- Status: It should be fixed before 1.3.7 went out. For details
- how it should be done, please look at new-httpd mailing list
- archive: Ken, Ralf and Roy have already found consensus in
the
- past there.
RELEASE NON-SHOWSTOPPERS BUT WOULD BE REAL NICE TO WRAP THESE UP:
1.1400+7 -0 apache-1.3/src/CHANGES
Index: CHANGES
===
RCS file: /home/cvs/apache-1.3/src/CHANGES,v
retrieving revision 1.1399
retrieving revision 1.1400
diff -u -r1.1399 -r1.1400
--- CHANGES 1999/07/24 18:48:20 1.1399
+++ CHANGES 1999/07/28 17:37:09 1.1400
@@ -1,5 +1,12 @@
Changes with Apache 1.3.7
+ *) Sanitise Vary values by not adding duplicate keywords. A
+ separate routine needs to be used to do this, so any module
+ that frobs Vary needs to be changed. The standard modules
+ have all been modified. This solution is somewhat inelegant,
+ but it does the job for now. PR#4118 (better fix than before)
+ [Ken Coar, Roy Fielding]
+
*) Link DSO's with gcc -shared instead of ld -Bshareable at
least on Linux and FreeBSD for now.
[Rasmus Lerdorf]
1.69 +4 -0 apache-1.3/src/include/alloc.h
Index: alloc.h
===
RCS file: /home/cvs/apache-1.3/src/include/alloc.h,v
retrieving revision 1.68
retrieving revision 1.69
diff -u -r1.68 -r1.69
--- alloc.h 1999/05/13 19:44:14 1.68
+++ alloc.h 1999/07/28 17:37:14 1.69
@@ -225,6 +225,10 @@
API_EXPORT(const char *) ap_table_get(const table *, const char *);
API_EXPORT(void) ap_table_set(table *, const char *name, const char *val);
API_EXPORT(void) ap_table_setn(table *, const char *name, const char *val);
+API_EXPORT(void) ap_table_merge_unique_token(table *t, const char *key,
+const char *val);
+API_EXPORT(void) ap_table_mergen_unique_token(table *t, const char *key,
+ const char *val);
API_EXPORT(void) ap_table_merge(table *, const char *name, const char
*more_val);
API_EXPORT(void) ap_table_mergen(table *, const char *name, const char
*more_val);
API_EXPORT(void) ap_table_unset(table *, const char *key);
1.114 +26 -0 apache-1.3/src/main/alloc.c
Index: alloc.c
===
RCS file: /home/cvs/apache-1.3/src/main/alloc.c,v
retrieving revision 1.113
retrieving revision 1.114
diff -u -r1.113 -r1.114
--- alloc.c 1999/05/25 15:32:54 1.113
+++ alloc.c 1999/07/28 17:37:16 1.114
@@ -1346,6 +1346,32 @@
}
}
+/*
+ * Merge an HTTP token into a table entry IFF it isn't already in there.
+ * (Intended primarily to avoid Vary: host, host.)
+ */
+API_EXPORT(void) ap_table_merge_unique_token(table *t, const char *key,
+const char *val)
+{
+const char *curval;
+
+curval = ap_table_get(t, key);
+if ((curval == NULL) || (!ap_find_token(t-a.pool, curval, val))) {
+