httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Roy T. Fielding" <field...@kiwi.ics.uci.edu>
Subject [PATCH] Core dump with Language Negotiation?!?
Date Mon, 18 Jan 1999 13:36:49 GMT
Martin, give this patch a try and see if it solves the problem.
I am pretty sure it will fix the core dump.  Note that this is really
an error in mod_dir.c -- negotiation just triggers it.

....Roy

Index: include/alloc.h
===================================================================
RCS file: /home/cvs/apache-1.3/src/include/alloc.h,v
retrieving revision 1.66
diff -u -r1.66 alloc.h
--- alloc.h	1999/01/03 12:04:36	1.66
+++ alloc.h	1999/01/18 13:31:24
@@ -227,6 +227,13 @@
 #define AP_OVERLAP_TABLES_MERGE	(1)
 API_EXPORT(void) ap_overlap_tables(table *a, const table *b, unsigned flags);
 
+/* ap_copyover_table does the same thing as ap_overlap_tables, but here
+ * the assumption is that the two tables are in different pools and thus
+ * we have no choice but to copy the keys and elements by value.
+ */
+API_EXPORT(void) ap_copyover_table(table *dest, const table *source,
+                                   unsigned flags);
+
 /* XXX: these know about the definition of struct table in alloc.c.  That
  * definition is not here because it is supposed to be private, and by not
  * placing it here we are able to get compile-time diagnostics from modules
Index: main/alloc.c
===================================================================
RCS file: /home/cvs/apache-1.3/src/main/alloc.c,v
retrieving revision 1.105
diff -u -r1.105 alloc.c
--- alloc.c	1999/01/03 12:04:37	1.105
+++ alloc.c	1999/01/18 13:31:25
@@ -1597,6 +1597,27 @@
     }
 }
 
+/* ap_copyover_table does the same thing as ap_overlap_tables, but here
+ * the assumption is that the two tables are in different pools and thus
+ * we have no choice but to copy the keys and elements by value.
+ */
+API_EXPORT(void) ap_copyover_table(table *dest, const table *source,
+                                   unsigned flags)
+{
+    array_header *sarr = ap_table_elts(source);
+    table_entry *selt = (table_entry *)sarr->elts;
+    int i;
+
+    for (i = 0; i < sarr->nelts; ++i) {
+        if (flags & AP_OVERLAP_TABLES_MERGE) {
+            ap_table_merge(dest, selt[i].key, selt[i].val);
+        }
+        else {
+            ap_table_set(dest, selt[i].key, selt[i].val);
+        }
+    }
+}
+
 /*****************************************************************
  *
  * Managing generic cleanups.  
Index: modules/standard/mod_dir.c
===================================================================
RCS file: /home/cvs/apache-1.3/src/modules/standard/mod_dir.c,v
retrieving revision 1.53
diff -u -r1.53 mod_dir.c
--- mod_dir.c	1999/01/01 19:05:08	1.53
+++ mod_dir.c	1999/01/18 13:31:25
@@ -180,11 +180,11 @@
             (rr->status == HTTP_NOT_ACCEPTABLE && num_names == 1)) {
 
             error_notfound = rr->status;
-            r->notes = ap_overlay_tables(r->pool, r->notes, rr->notes);
-            r->headers_out = ap_overlay_tables(r->pool, r->headers_out,
-                                            rr->headers_out);
-            r->err_headers_out = ap_overlay_tables(r->pool, r->err_headers_out,
-                                                rr->err_headers_out);
+            ap_copyover_table(r->notes, rr->notes, AP_OVERLAP_TABLES_MERGE);
+            ap_copyover_table(r->headers_out, rr->headers_out,
+                              AP_OVERLAP_TABLES_MERGE);
+            ap_copyover_table(r->err_headers_out, rr->err_headers_out,
+                              AP_OVERLAP_TABLES_MERGE);
             ap_destroy_sub_req(rr);
             return error_notfound;
         }

Mime
View raw message