You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by dg...@hyperreal.org on 1998/01/20 01:59:13 UTC
cvs commit: apache/src CHANGES alloc.c
dgaudet 98/01/19 16:59:12
Modified: . Tag: APACHE_1_2_X STATUS
src Tag: APACHE_1_2_X CHANGES alloc.c
Log:
Make table_{set,unset}() deal correctly with multiple occurrences of the
same key.
PR: 1604
Submitted by: Stephen Scheck <ss...@infonex.net>, Ben
Reviewed by: Ben Laurie, Dean Gaudetj
Revision Changes Path
No revision
No revision
1.1.2.20 +1 -0 apache/Attic/STATUS
Index: STATUS
===================================================================
RCS file: /export/home/cvs/apache/Attic/STATUS,v
retrieving revision 1.1.2.19
retrieving revision 1.1.2.20
diff -u -r1.1.2.19 -r1.1.2.20
--- STATUS 1998/01/20 00:54:37 1.1.2.19
+++ STATUS 1998/01/20 00:59:08 1.1.2.20
@@ -17,6 +17,7 @@
* proxy was sending HTTP/1.1 responses in error
* PR#1500: allocate r->connection->user in correct pool
* PR#1366: send_fd_length did not calculate total_bytes_sent properly
+ * PR#1604: table_{set,unset} didn't deal correctly with multiple keys
Available:
No revision
No revision
1.286.2.72 +4 -0 apache/src/CHANGES
Index: CHANGES
===================================================================
RCS file: /export/home/cvs/apache/src/CHANGES,v
retrieving revision 1.286.2.71
retrieving revision 1.286.2.72
diff -u -r1.286.2.71 -r1.286.2.72
--- CHANGES 1998/01/20 00:54:38 1.286.2.71
+++ CHANGES 1998/01/20 00:59:10 1.286.2.72
@@ -1,4 +1,8 @@
Changes with Apache 1.2.6
+
+ *) table_set() and table_unset() did not deal correctly with
+ multiple occurrences of the same key. [Stephen Scheck
+ <ss...@infonex.net>, Ben Laurie] PR#1604
*) send_fd_length() did not calculate total_bytes_sent properly in error
cases. [Ben Reser <br...@regnow.com>] PR#1366
1.28.2.2 +12 -3 apache/src/alloc.c
Index: alloc.c
===================================================================
RCS file: /export/home/cvs/apache/src/alloc.c,v
retrieving revision 1.28.2.1
retrieving revision 1.28.2.2
diff -u -r1.28.2.1 -r1.28.2.2
--- alloc.c 1997/06/27 01:47:44 1.28.2.1
+++ alloc.c 1998/01/20 00:59:11 1.28.2.2
@@ -578,11 +578,12 @@
table_entry *elts = (table_entry *)t->elts;
int done = 0;
- for (i = 0; i < t->nelts; ++i)
+ for (i = 0; i < t->nelts;) {
if (!strcasecmp (elts[i].key, key)) {
if (!done) {
elts[i].val = pstrdup(t->pool, val);
done = 1;
+ ++i;
}
else { /* delete an extraneous element */
for (j = i, k = i + 1; k < t->nelts; ++j, ++k) {
@@ -592,6 +593,10 @@
--t->nelts;
}
}
+ else {
+ ++i;
+ }
+ }
if (!done) {
elts = (table_entry *)push_array(t);
@@ -605,7 +610,7 @@
register int i, j, k;
table_entry *elts = (table_entry *)t->elts;
- for (i = 0; i < t->nelts; ++i)
+ for (i = 0; i < t->nelts;) {
if (!strcasecmp (elts[i].key, key)) {
/* found an element to skip over
@@ -619,7 +624,11 @@
}
--t->nelts;
}
-}
+ else {
+ ++i;
+ }
+ }
+}
void table_merge (table *t, const char *key, const char *val)
{