summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'www-servers/varnish/files/varnish-2.1.4-virtual-ncsa.patch')
-rw-r--r--www-servers/varnish/files/varnish-2.1.4-virtual-ncsa.patch57
1 files changed, 57 insertions, 0 deletions
diff --git a/www-servers/varnish/files/varnish-2.1.4-virtual-ncsa.patch b/www-servers/varnish/files/varnish-2.1.4-virtual-ncsa.patch
new file mode 100644
index 000000000000..4c5bb25b1f4b
--- /dev/null
+++ b/www-servers/varnish/files/varnish-2.1.4-virtual-ncsa.patch
@@ -0,0 +1,57 @@
+diff -Naur varnish-2.1.4.orig/bin/varnishncsa/varnishncsa.c varnish-2.1.4/bin/varnishncsa/varnishncsa.c
+--- varnish-2.1.4.orig/bin/varnishncsa/varnishncsa.c 2010-10-21 17:45:41.000000000 +0200
++++ varnish-2.1.4/bin/varnishncsa/varnishncsa.c 2010-10-21 22:42:50.000000000 +0200
+@@ -102,6 +102,7 @@
+
+ static size_t nll;
+ static int prefer_x_forwarded_for = 0;
++static int virtual_host_style_logging = 0;
+
+ static int
+ isprefix(const char *str, const char *prefix, const char *end,
+@@ -469,6 +470,11 @@
+
+ fo = priv;
+
++ /* the -v option */
++ if (virtual_host_style_logging) {
++ fprintf(fo, "%s ", lp->df_Host);
++ }
++
+ /* %h */
+ if (!lp->df_h && spec & VSL_S_BACKEND)
+ fprintf(fo, "127.0.0.1 ");
+@@ -508,7 +514,7 @@
+ * normalized the request URL.
+ */
+ fprintf(fo, "\"%s ", lp->df_m);
+- if (lp->df_Host) {
++ if (!virtual_host_style_logging && lp->df_Host) {
+ if (strncmp(lp->df_Host, "http://", 7) != 0)
+ fprintf(fo, "http://");
+ fprintf(fo, "%s", lp->df_Host);
+@@ -568,7 +574,7 @@
+ {
+
+ fprintf(stderr,
+- "usage: varnishncsa %s [-aDV] [-n varnish_name] "
++ "usage: varnishncsa %s [-avDV] [-n varnish_name] "
+ "[-P file] [-w file]\n", VSL_USAGE);
+ exit(1);
+ }
+@@ -587,11 +593,14 @@
+
+ vd = VSL_New();
+
+- while ((c = getopt(argc, argv, VSL_ARGS "aDn:P:Vw:f")) != -1) {
++ while ((c = getopt(argc, argv, VSL_ARGS "avDn:P:Vw:f")) != -1) {
+ switch (c) {
+ case 'a':
+ a_flag = 1;
+ break;
++ case 'v':
++ virtual_host_style_logging = 1;
++ break;
+ case 'f':
+ prefer_x_forwarded_for = 1;
+ break;