[experimental-ims] 0820070 Add rudimentary -X support to varnishncsa
Geoff Simmons
geoff at varnish-cache.org
Wed Aug 31 16:04:45 CEST 2011
commit 08200709bd2482fa0f4702c28d1a28cef6f345dc
Author: Tollef Fog Heen <tfheen at varnish-software.com>
Date: Tue Aug 30 09:04:27 2011 +0200
Add rudimentary -X support to varnishncsa
Avoid crashing if an -X parameter is passed, and skip any requests
where the URL or Host matches the -X parameter.
diff --git a/bin/varnishncsa/varnishncsa.c b/bin/varnishncsa/varnishncsa.c
index ce58fdc..76bd83d 100644
--- a/bin/varnishncsa/varnishncsa.c
+++ b/bin/varnishncsa/varnishncsa.c
@@ -624,6 +624,13 @@ h_ncsa(void *priv, enum VSL_tag_e tag, unsigned fd,
* Fake "%r". This would be a lot easier if Varnish
* normalized the request URL.
*/
+ if (!lp->df_m ||
+ !req_header(lp, "Host") ||
+ !lp->df_U ||
+ !lp->df_H) {
+ clean_logline(lp);
+ return (reopen);
+ }
VSB_cat(os, lp->df_m);
VSB_putc(os, ' ');
if (req_header(lp, "Host")) {
More information about the varnish-commit
mailing list