/*
- * $Id: HttpHeaderTools.cc,v 1.50 2005/09/17 05:50:07 wessels Exp $
+ * $Id: HttpHeaderTools.cc,v 1.51 2005/11/04 20:23:18 wessels Exp $
*
* DEBUG: section 66 HTTP Header Tools
* AUTHOR: Alex Rousskov
if (0 == httpHdrMangle(e, request, req_or_rep))
httpHeaderDelAt(l, p);
}
+
+/*
+ * return 1 if manglers are configured. Used to set a flag
+ * for optimization during request forwarding.
+ */
+int
+httpHdrManglersConfigured()
+{
+ for (int i = 0; i < HDR_ENUM_END; i++) {
+ if (NULL != Config.request_header_access[i].access_list)
+ return 1;
+ }
+
+ return 0;
+}
/*
- * $Id: cache_cf.cc,v 1.483 2005/10/28 18:49:46 serassio Exp $
+ * $Id: cache_cf.cc,v 1.484 2005/11/04 20:23:18 wessels Exp $
*
* DEBUG: section 3 Configuration File Parsing
* AUTHOR: Harvest Derived
if (aclPurgeMethodInUse(Config.accessList.http))
Config2.onoff.enable_purge = 1;
+ Config2.onoff.mangle_headers = httpHdrManglersConfigured();
+
if (geteuid() == 0) {
if (NULL != Config.effectiveUser) {
/*
- * $Id: http.cc,v 1.462 2005/10/18 19:55:28 serassio Exp $
+ * $Id: http.cc,v 1.463 2005/11/04 20:23:18 wessels Exp $
*
* DEBUG: section 11 Hypertext Transfer Protocol (HTTP)
* AUTHOR: Harvest Derived
}
/* Now mangle the headers. */
- httpHdrMangleList(hdr_out, request, ROR_REQUEST);
+ if (Config2.onoff.mangle_headers)
+ httpHdrMangleList(hdr_out, request, ROR_REQUEST);
strConnection.clean();
}
/*
- * $Id: protos.h,v 1.511 2005/09/15 19:04:56 wessels Exp $
+ * $Id: protos.h,v 1.512 2005/11/04 20:23:18 wessels Exp $
*
*
* SQUID Web Proxy Cache http://www.squid-cache.org/
/* store report about current header usage and other stats */
SQUIDCEXTERN void httpHeaderStoreReport(StoreEntry * e);
SQUIDCEXTERN void httpHdrMangleList(HttpHeader *, HttpRequest *, int req_or_rep);
+SQUIDCEXTERN int httpHdrManglersConfigured();
SQUIDCEXTERN void icmpOpen(void);
SQUIDCEXTERN void icmpClose(void);
/*
- * $Id: structs.h,v 1.529 2005/09/25 20:25:56 hno Exp $
+ * $Id: structs.h,v 1.530 2005/11/04 20:23:18 wessels Exp $
*
*
* SQUID Web Proxy Cache http://www.squid-cache.org/
struct
{
int enable_purge;
+ int mangle_headers;
}
onoff;