Index: trunk/debs/varnish3/debian/patches/01-varnishncsa-udp.dpatch |
— | — | @@ -7,7 +7,7 @@ |
8 | 8 | @DPATCH@ |
9 | 9 | |
10 | 10 | --- varnish3-3.0.0~/bin/varnishncsa/varnishncsa.c 2011-08-09 23:55:17.000000000 +0000 |
11 | | -+++ varnish3-3.0.0/bin/varnishncsa/varnishncsa.c 2011-09-14 21:52:17.000000000 +0000 |
12 | 11 | @@ -79,6 +79,12 @@ |
13 | 12 | #include "varnishapi.h" |
14 | 13 | #include "base64.h" |
— | — | @@ -25,7 +25,7 @@ |
26 | 26 | |
27 | 27 | static const char *format; |
28 | 28 | |
29 | | -+struct hostent* h; |
| 29 | ++static char localhost[255]; |
30 | 30 | + |
31 | 31 | static int |
32 | 32 | isprefix(const char *str, const char *prefix, const char *end, |
— | — | @@ -46,7 +46,7 @@ |
47 | 47 | + |
48 | 48 | case 'l': |
49 | 49 | - fprintf(fo, "-"); |
50 | | -+ fprintf(fo, "%s", h->h_name); |
| 50 | ++ fprintf(fo, "%s", localhost); |
51 | 51 | break; |
52 | 52 | |
53 | 53 | case 'm': |
— | — | @@ -140,18 +140,19 @@ |
141 | 141 | exit(1); |
142 | 142 | } |
143 | 143 | |
144 | | -@@ -723,8 +785,9 @@ |
| 144 | +@@ -723,8 +785,10 @@ |
145 | 145 | const char *P_arg = NULL; |
146 | 146 | const char *w_arg = NULL; |
147 | 147 | struct vpf_fh *pfh = NULL; |
148 | 148 | + char hostname[1024]; |
| 149 | ++ struct hostent *lh; |
149 | 150 | FILE *of; |
150 | 151 | - format = "%h %l %u %t \"%r\" %s %b \"%{Referer}i\" \"%{User-agent}i\""; |
151 | 152 | + format = "%l %n %t %{Varnish:time_firstbyte}x %h %{Varnish:handling}x/%s %b %m http://%{Host}i%U%q - - %{Referer}i %{X-Forwarded-For}i %{User-agent}i"; |
152 | 153 | |
153 | 154 | vd = VSM_New(); |
154 | 155 | VSL_Setup(vd); |
155 | | -@@ -739,7 +802,7 @@ |
| 156 | +@@ -739,7 +803,7 @@ |
156 | 157 | fprintf(stderr, "-f and -F can not be combined\n"); |
157 | 158 | exit(1); |
158 | 159 | } |
— | — | @@ -160,13 +161,14 @@ |
161 | 162 | format_flag = 1; |
162 | 163 | break; |
163 | 164 | case 'F': |
164 | | -@@ -786,6 +849,10 @@ |
| 165 | +@@ -786,6 +850,11 @@ |
165 | 166 | } |
166 | 167 | } |
167 | 168 | |
168 | 169 | + hostname[1023] = '\0'; |
169 | 170 | + gethostname(hostname, 1023); |
170 | | -+ h = gethostbyname(hostname); |
| 171 | ++ lh = gethostbyname(hostname); |
| 172 | ++ strcpy(localhost, lh->h_name); |
171 | 173 | + |
172 | 174 | VSL_Arg(vd, 'c', optarg); |
173 | 175 | |