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/06/23 09:31:10 UTC
cvs commit: apache-1.3/src/modules/proxy proxy_http.c
dgaudet 98/06/23 00:31:10
Modified: src/modules/proxy proxy_http.c
Log:
Fix another bug that Ben's const char * changes identified... this fix is
untested though. It's not correct to modify the return from ap_table_get
under any circumstance, even if you are about to delete it from the
table.
Revision Changes Path
1.50 +4 -7 apache-1.3/src/modules/proxy/proxy_http.c
Index: proxy_http.c
===================================================================
RCS file: /export/home/cvs/apache-1.3/src/modules/proxy/proxy_http.c,v
retrieving revision 1.49
retrieving revision 1.50
diff -u -r1.49 -r1.50
--- proxy_http.c 1998/06/13 15:23:01 1.49
+++ proxy_http.c 1998/06/23 07:31:08 1.50
@@ -134,13 +134,10 @@
}
/* Clear all connection-based headers from the incoming headers table */
-static void clear_connection(table *headers)
+static void clear_connection(pool *p, table *headers)
{
const char *name;
- /* Although we shouldn't alter the return from ap_table_get, in this case
- its OK, coz we're going to delete the entry anyway
- */
- char *next = (char *)ap_table_get(headers, "Connection");
+ char *next = ap_pstrdup(p, ap_table_get(headers, "Connection"));
ap_table_unset(headers, "Proxy-Connection");
if (!next)
@@ -296,7 +293,7 @@
strerror(errno), NULL));
}
- clear_connection(r->headers_in); /* Strip connection-based headers */
+ clear_connection(r->pool, r->headers_in); /* Strip connection-based headers */
f = ap_bcreate(p, B_RDWR | B_SOCKET);
ap_bpushfd(f, sock, sock);
@@ -362,7 +359,7 @@
resp_hdrs = ap_proxy_read_headers(p, buffer, HUGE_STRING_LEN, f);
- clear_connection((table *) resp_hdrs); /* Strip Connection hdrs */
+ clear_connection(p, (table *) resp_hdrs); /* Strip Connection hdrs */
}
else {
/* an http/0.9 response */