Index: trunk/debs/varnish3/debian/patches/debian-changes-3.0.0-1wmf6 |
— | — | @@ -1,61 +0,0 @@ |
2 | | -+++ varnish3-3.0.0/bin/varnishncsa/varnishncsa.c |
3 | | -@@ -85,7 +85,6 @@ |
4 | | - #include <netdb.h> |
5 | | - |
6 | | - static long int sequence_number = 0; |
7 | | -- |
8 | | - static volatile sig_atomic_t reopen; |
9 | | - |
10 | | - static struct logline { |
11 | | -@@ -118,6 +117,8 @@ static int m_flag = 0; |
12 | | - |
13 | | - static const char *format; |
14 | | - |
15 | | -+struct hostent* h; |
16 | | -+ |
17 | | - static int |
18 | | - isprefix(const char *str, const char *prefix, const char *end, |
19 | | - const char **next) |
20 | | -@@ -568,8 +569,9 @@ h_ncsa(void *priv, enum VSL_tag_e tag, u |
21 | | - else |
22 | | - fprintf(fo, "%s", lp->df_h ? lp->df_h : "-"); |
23 | | - break; |
24 | | -+ |
25 | | - case 'l': |
26 | | -- fprintf(fo, "-"); |
27 | | -+ fprintf(fo, "%s", h->h_name); |
28 | | - break; |
29 | | - |
30 | | - case 'm': |
31 | | -@@ -783,8 +785,9 @@ main(int argc, char *argv[]) |
32 | | - const char *P_arg = NULL; |
33 | | - const char *w_arg = NULL; |
34 | | - struct vpf_fh *pfh = NULL; |
35 | | -+ char hostname[1024]; |
36 | | - FILE *of; |
37 | | -- format = "%h %n %l %u %t \"%r\" %s %b \"%{Referer}i\" \"%{User-agent}i\""; |
38 | | -+ 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"; |
39 | | - |
40 | | - vd = VSM_New(); |
41 | | - VSL_Setup(vd); |
42 | | -@@ -799,7 +802,7 @@ main(int argc, char *argv[]) |
43 | | - fprintf(stderr, "-f and -F can not be combined\n"); |
44 | | - exit(1); |
45 | | - } |
46 | | -- format = "%{X-Forwarded-For}i %n %l %u %t \"%r\" %s %b \"%{Referer}i\" \"%{User-agent}i\""; |
47 | | -+ format = "%l %n %t %{Varnish:time_firstbyte}x %{X-Forwarded-For} %{Varnish:handling}x/%s %b %m http://%{Host}i%U%q - - %{Referer}i %{X-Forwarded-For}i %{User-agent}i"; |
48 | | - format_flag = 1; |
49 | | - break; |
50 | | - case 'F': |
51 | | -@@ -846,6 +849,10 @@ main(int argc, char *argv[]) |
52 | | - } |
53 | | - } |
54 | | - |
55 | | -+ hostname[1023] = '\0'; |
56 | | -+ gethostname(hostname, 1023); |
57 | | -+ h = gethostbyname(hostname); |
58 | | -+ |
59 | | - VSL_Arg(vd, 'c', optarg); |
60 | | - |
61 | | - if (VSL_Open(vd, 1)) |
Index: trunk/debs/varnish3/debian/patches/series |
— | — | @@ -1 +0,0 @@ |
2 | | -debian-changes-3.0.0-1wmf6 |
Index: trunk/debs/varnish3/debian/patches/01-varnishncsa-udp.dpatch |
— | — | @@ -2,13 +2,13 @@ |
3 | 3 | ## 01-varnishncsa-udp.dpatch by <root@ragweed.knams.wikimedia.org> |
4 | 4 | ## |
5 | 5 | ## All lines beginning with `## DP:' are a description of the patch. |
6 | | -## DP: add server name to log output, format more like wmf squidlog |
| 6 | +## DP: No description. |
7 | 7 | |
8 | 8 | @DPATCH@ |
9 | | - |
10 | | -+++ varnish3-3.0.0/bin/varnishncsa/varnishncsa.c 2011-09-15 19:52:25.000000000 +0000 |
11 | | -@@ -79,6 +79,12 @@ |
| 9 | +diff -urNad varnish3-3.0.2~/bin/varnishncsa/varnishncsa.c varnish3-3.0.2/bin/varnishncsa/varnishncsa.c |
| 10 | +--- varnish3-3.0.2~/bin/varnishncsa/varnishncsa.c 2012-01-05 23:25:10.000000000 +0000 |
| 11 | +@@ -79,6 +79,13 @@ |
12 | 12 | #include "varnishapi.h" |
13 | 13 | #include "base64.h" |
14 | 14 | |
— | — | @@ -18,10 +18,11 @@ |
19 | 19 | +#include <netdb.h> |
20 | 20 | + |
21 | 21 | +static long int sequence_number = 0; |
| 22 | ++char seqbuf[21]; |
22 | 23 | static volatile sig_atomic_t reopen; |
23 | 24 | |
24 | | - static struct logline { |
25 | | -@@ -111,6 +117,8 @@ |
| 25 | + struct hdr { |
| 26 | +@@ -115,6 +122,8 @@ |
26 | 27 | |
27 | 28 | static const char *format; |
28 | 29 | |
— | — | @@ -30,45 +31,98 @@ |
31 | 32 | static int |
32 | 33 | isprefix(const char *str, const char *prefix, const char *end, |
33 | 34 | const char **next) |
34 | | -@@ -533,6 +541,8 @@ |
| 35 | +@@ -526,6 +535,31 @@ |
| 36 | + return (1); |
| 37 | + } |
| 38 | + |
| 39 | ++char *str_replace(const char *s, const char *old, const char *new) |
| 40 | ++{ |
| 41 | ++ char *ret; |
| 42 | ++ int i = 0; |
| 43 | ++ size_t newlen = strlen(new); |
| 44 | ++ size_t oldlen = strlen(old); |
| 45 | ++ |
| 46 | ++ ret = malloc(4096); |
| 47 | ++ if (ret == NULL) |
| 48 | ++ exit(1); |
| 49 | ++ |
| 50 | ++ i = 0; |
| 51 | ++ while (*s) { |
| 52 | ++ if (strstr(s, old) == s) { |
| 53 | ++ strcpy(&ret[i], new); |
| 54 | ++ i += newlen; |
| 55 | ++ s += oldlen; |
| 56 | ++ } else |
| 57 | ++ ret[i++] = *s++; |
| 58 | ++ } |
| 59 | ++ ret[i] = '\0'; |
| 60 | ++ |
| 61 | ++ return ret; |
| 62 | ++} |
| 63 | ++ |
| 64 | + static int |
| 65 | + h_ncsa(void *priv, enum VSL_tag_e tag, unsigned fd, |
| 66 | + unsigned len, unsigned spec, const char *ptr, uint64_t bitmap) |
| 67 | +@@ -534,6 +568,7 @@ |
| 68 | + FILE *fo = priv; |
| 69 | + char *q, tbuf[64]; |
| 70 | + const char *p; |
| 71 | ++ char *nh; |
| 72 | + struct vsb *os; |
| 73 | + |
| 74 | + if (fd >= nll) { |
| 75 | +@@ -583,6 +618,7 @@ |
35 | 76 | /* We have a complete data set - log a line */ |
36 | 77 | |
37 | 78 | fo = priv; |
38 | | -+ |
39 | 79 | + sequence_number++; |
| 80 | + os = VSB_new_auto(); |
40 | 81 | |
41 | 82 | for (p = format; *p != '\0'; p++) { |
42 | | - |
43 | | -@@ -559,13 +569,18 @@ |
44 | | - else |
45 | | - fprintf(fo, "%s", lp->df_h ? lp->df_h : "-"); |
| 83 | +@@ -610,12 +646,17 @@ |
| 84 | + VSB_cat(os, lp->df_h ? lp->df_h : "-"); |
46 | 85 | break; |
47 | | -+ |
48 | 86 | case 'l': |
49 | | -- fprintf(fo, "-"); |
50 | | -+ fprintf(fo, "%s", localhost); |
| 87 | +- VSB_putc(os, '-'); |
| 88 | ++ VSB_cat(os, localhost); |
51 | 89 | break; |
52 | 90 | |
53 | 91 | case 'm': |
54 | | - fprintf(fo, "%s", lp->df_m); |
| 92 | + VSB_cat(os, lp->df_m ? lp->df_m : "-"); |
55 | 93 | break; |
56 | 94 | + |
57 | 95 | + case 'n': |
58 | | -+ fprintf(fo, "%ld", sequence_number); |
| 96 | ++ snprintf(seqbuf, sizeof(seqbuf), "%ld", sequence_number); |
| 97 | ++ VSB_cat(os, seqbuf); |
59 | 98 | + break; |
60 | 99 | |
61 | 100 | case 'q': |
62 | | - fprintf(fo, "%s", lp->df_q ? lp->df_q : ""); |
63 | | -@@ -594,7 +609,7 @@ |
| 101 | + VSB_cat(os, lp->df_q ? lp->df_q : ""); |
| 102 | +@@ -648,7 +689,7 @@ |
64 | 103 | |
65 | 104 | case 't': |
66 | 105 | /* %t */ |
67 | 106 | - strftime(tbuf, sizeof tbuf, "[%d/%b/%Y:%T %z]", &lp->df_t); |
68 | 107 | + strftime(tbuf, sizeof tbuf, "%Y-%m-%dT%T", &lp->df_t); /* 2011-08-11T21:17:01 - no ms from strftim */ |
69 | | - fprintf(fo, "%s", tbuf); |
| 108 | + VSB_cat(os, tbuf); |
70 | 109 | break; |
71 | 110 | |
72 | | -@@ -695,12 +710,59 @@ |
| 111 | +@@ -694,7 +735,13 @@ |
| 112 | + switch (type) { |
| 113 | + case 'i': |
| 114 | + h = req_header(lp, fname); |
| 115 | +- VSB_cat(os, h ? h : "-"); |
| 116 | ++ if (h) { |
| 117 | ++ nh = str_replace(h, " ", "%20"); |
| 118 | ++ VSB_cat(os, nh); |
| 119 | ++ free(nh); |
| 120 | ++ } else { |
| 121 | ++ VSB_cat(os, "-"); |
| 122 | ++ } |
| 123 | + p = tmp; |
| 124 | + break; |
| 125 | + case 'o': |
| 126 | +@@ -756,12 +803,59 @@ |
73 | 127 | open_log(const char *ofn, int append) |
74 | 128 | { |
75 | 129 | FILE *of; |
— | — | @@ -80,7 +134,9 @@ |
81 | 135 | + char host[500]; |
82 | 136 | + char port[10]; |
83 | 137 | + char loopch=0; |
84 | | -+ |
| 138 | + |
| 139 | +- if ((of = fopen(ofn, append ? "a" : "w")) == NULL) { |
| 140 | +- perror(ofn); |
85 | 141 | + sscanf(ofn, "%[^:]:%s", host, port); |
86 | 142 | + |
87 | 143 | + portno = atoi(port); |
— | — | @@ -94,7 +150,7 @@ |
95 | 151 | + |
96 | 152 | + if (server == NULL) { |
97 | 153 | + fprintf(stderr,"ERROR, no such host\n"); |
98 | | -+ exit(1); |
| 154 | + exit(1); |
99 | 155 | + } |
100 | 156 | + |
101 | 157 | + bzero((char *) &serv_addr, sizeof(serv_addr)); |
— | — | @@ -111,7 +167,8 @@ |
112 | 168 | + sizeof(unsigned char)); |
113 | 169 | + setsockopt(sockfd, IPPROTO_IP, IP_MULTICAST_LOOP, /* don't send to own interface */ |
114 | 170 | + (char *)&loopch, sizeof(loopch)); |
115 | | -+ } |
| 171 | + } |
| 172 | +- return (of); |
116 | 173 | + |
117 | 174 | + if (connect(sockfd,(struct sockaddr *) &serv_addr,sizeof(serv_addr)) < 0) { |
118 | 175 | + perror("socket"); |
— | — | @@ -119,19 +176,16 @@ |
120 | 177 | + } |
121 | 178 | + |
122 | 179 | + FILE *sf = fdopen(sockfd, "w"); |
123 | | - |
124 | | -- if ((of = fopen(ofn, append ? "a" : "w")) == NULL) { |
125 | | -- perror(ofn); |
| 180 | ++ |
126 | 181 | + if (sf == NULL) { |
127 | | - exit(1); |
128 | | - } |
129 | | -- return (of); |
| 182 | ++ exit(1); |
| 183 | ++ } |
130 | 184 | + |
131 | 185 | + return (sf); |
132 | 186 | } |
133 | 187 | |
134 | 188 | /*--------------------------------------------------------------------*/ |
135 | | -@@ -711,7 +773,7 @@ |
| 189 | +@@ -772,7 +866,7 @@ |
136 | 190 | |
137 | 191 | fprintf(stderr, |
138 | 192 | "usage: varnishncsa %s [-aDV] [-n varnish_name] " |
— | — | @@ -140,7 +194,7 @@ |
141 | 195 | exit(1); |
142 | 196 | } |
143 | 197 | |
144 | | -@@ -723,8 +785,10 @@ |
| 198 | +@@ -784,8 +878,10 @@ |
145 | 199 | const char *P_arg = NULL; |
146 | 200 | const char *w_arg = NULL; |
147 | 201 | struct vpf_fh *pfh = NULL; |
— | — | @@ -152,7 +206,7 @@ |
153 | 207 | |
154 | 208 | vd = VSM_New(); |
155 | 209 | VSL_Setup(vd); |
156 | | -@@ -739,7 +803,7 @@ |
| 210 | +@@ -800,7 +896,7 @@ |
157 | 211 | fprintf(stderr, "-f and -F can not be combined\n"); |
158 | 212 | exit(1); |
159 | 213 | } |
— | — | @@ -161,7 +215,7 @@ |
162 | 216 | format_flag = 1; |
163 | 217 | break; |
164 | 218 | case 'F': |
165 | | -@@ -786,6 +850,11 @@ |
| 219 | +@@ -847,6 +943,11 @@ |
166 | 220 | } |
167 | 221 | } |
168 | 222 | |
Index: trunk/debs/varnish3/debian/changelog |
— | — | @@ -1,8 +1,9 @@ |
2 | | -varnish3 (3.0.0-1wmf7) lucid; urgency=low |
| 2 | +varnish3 (3.0.2-1wmf1) lucid; urgency=low |
3 | 3 | |
4 | | - * remove extra whitespace from log lines |
| 4 | + * uri escape spaces (only) in logged req headers |
| 5 | + * port udplog patch to varnish 3.0.2 |
5 | 6 | |
6 | | - -- Asher Feldman <afledman@wikimedia.org> Tue, 29 Nov 2011 19:54:00 +0000 |
| 7 | + -- Asher Feldman <afledman@wikimedia.org> Wed, 22 Dec 2011 12:12:00 +0000 |
7 | 8 | |
8 | 9 | varnish3 (3.0.0-1wmf6) lucid; urgency=low |
9 | 10 | |
Index: trunk/debs/varnish3/debian/rules |
— | — | @@ -6,13 +6,16 @@ |
7 | 7 | |
8 | 8 | DH_VERBOSE=1 |
9 | 9 | |
| 10 | +# disable dh_strip when using auto build |
| 11 | +DEB_BUILD_OPTIONS=nostrip |
| 12 | + |
10 | 13 | # List of architectures that lack the *_2POW definitions in varnish, |
11 | 14 | # which is needed by jemalloc |
12 | 15 | DISABLE_JEMALLOC_ARCH_LIST := :hppa:s390:sparc:m68k: |
13 | 16 | |
14 | 17 | # List of architectures (or buildds) that fail "make test" for some |
15 | 18 | # reason or another |
16 | | -DISABLE_TEST_ARCH_LIST := :armel:hppa:ia64:mipsel:sh4:sparc: |
| 19 | +DISABLE_TEST_ARCH_LIST := :armel:hppa:ia64:mipsel:sh4:sparc:x86_64 |
17 | 20 | |
18 | 21 | # Explicitly initialize a variable to select architecture, unless it has been |
19 | 22 | # defined before. This is compared against the DISABLE_*_LIST variables later |
— | — | @@ -26,7 +29,6 @@ |
27 | 30 | LOCAL_CONFIGURE_FLAGS += --disable-jemalloc |
28 | 31 | endif |
29 | 32 | |
30 | | - |
31 | 33 | #config.status: configure |
32 | 34 | # dh_testdir |
33 | 35 | # # Add here commands to configure the package. |
— | — | @@ -97,11 +99,9 @@ |
98 | 100 | dpatch apply-all |
99 | 101 | dh $@ |
100 | 102 | |
101 | | -# Disable build tests for some architectures |
102 | | -ifneq (,$(findstring :$(DEB_HOST_ARCH):,$(DISABLE_TEST_ARCH_LIST))) |
| 103 | +# Disable build tests |
103 | 104 | override_dh_auto_test: |
104 | 105 | @echo "dh_auto_test disabled on $(DEB_HOST_ARCH)" |
105 | | -endif |
106 | 106 | |
107 | 107 | override_dh_make: |
108 | 108 | dh_make --dpatch |
Index: trunk/debs/varnish3/debian/patched/01-varnishncsa-udp.dpatch |
— | — | @@ -1 +0,0 @@ |
2 | | -patching file bin/varnishncsa/varnishncsa.c |