Gentoo Logo
Gentoo Spaceship




Note: Due to technical difficulties, the Archives are currently not up to date. GMANE provides an alternative service for most mailing lists.
c.f. bug 424647
List Archive: gentoo-commits
Navigation:
Lists: gentoo-commits: < Prev By Thread Next > < Prev By Date Next >
Headers:
To: gentoo-commits@g.o
From: "Benedikt Boehm (hollow)" <hollow@g.o>
Subject: gentoo-x86 commit in www-servers/varnish/files: varnish-2.0.4-virtual-ncsa.patch
Date: Thu, 11 Jun 2009 09:50:42 +0000
hollow      09/06/11 09:50:42

  Added:                varnish-2.0.4-virtual-ncsa.patch
  Log:
  support virtual host log format in varnishncsa (upstream #485)
  (Portage version: 2.2_rc33/cvs/Linux i686)

Revision  Changes    Path
1.1                  www-servers/varnish/files/varnish-2.0.4-virtual-ncsa.patch

file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/www-servers/varnish/files/varnish-2.0.4-virtual-ncsa.patch?rev=1.1&view=markup
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/www-servers/varnish/files/varnish-2.0.4-virtual-ncsa.patch?rev=1.1&content-type=text/plain

Index: varnish-2.0.4-virtual-ncsa.patch
===================================================================
diff -NurpP varnish-2.0.4.orig/bin/varnishncsa/varnishncsa.c varnish-2.0.4/bin/varnishncsa/varnishncsa.c
--- varnish-2.0.4.orig/bin/varnishncsa/varnishncsa.c	2009-04-01 15:35:14.000000000 +0200
+++ varnish-2.0.4/bin/varnishncsa/varnishncsa.c	2009-06-11 11:45:44.084537099 +0200
@@ -102,6 +102,7 @@ static struct logline {
 
 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,
@@ -399,6 +400,11 @@ h_ncsa(void *priv, enum shmlogtag tag, u
 	if (!lp->bogus) {
 		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 ");
@@ -438,7 +444,7 @@ h_ncsa(void *priv, enum shmlogtag tag, u
 		 * 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);
@@ -512,7 +518,7 @@ usage(void)
 {
 
 	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);
 }
@@ -531,11 +537,14 @@ main(int argc, char *argv[])
 
 	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;





Navigation:
Lists: gentoo-commits: < Prev By Thread Next > < Prev By Date Next >
Previous by thread:
gentoo-x86 commit in x11-themes/noia: noia-1.0-r1.ebuild ChangeLog
Next by thread:
gentoo-x86 commit in www-servers/varnish: varnish-2.0.4.ebuild ChangeLog
Previous by date:
gentoo-x86 commit in x11-themes/noia: noia-1.0-r1.ebuild ChangeLog
Next by date:
gentoo-x86 commit in www-servers/varnish: varnish-2.0.4.ebuild ChangeLog


Updated May 05, 2012

Summary: Archive of the gentoo-commits mailing list.

Donate to support our development efforts.

Copyright 2001-2013 Gentoo Foundation, Inc. Questions, Comments? Contact us.