]>
Commit | Line | Data |
---|---|---|
a545f88e AF |
1 | diff -Naur squidclamav-5.11.org/src/squidclamav.c squidclamav-5.11/src/squidclamav.c |
2 | --- squidclamav-5.11.org/src/squidclamav.c 2012-10-29 09:46:06.000000000 +0100 | |
3 | +++ squidclamav-5.11/src/squidclamav.c 2014-06-03 12:26:36.215696508 +0200 | |
ccf1cb25 MT |
4 | @@ -483,7 +483,7 @@ |
5 | aren't appropriate, then just echo back the line from stdin */ | |
6 | if (buff_status == 1) { | |
7 | logit(log_file, "DEBUG Invalid input buffer, aborting: %s\n", sbuff); | |
8 | - puts(""); | |
9 | + puts("BH message=\"Invalid input buffer\""); | |
10 | fflush(stdout); | |
11 | continue; | |
12 | } | |
13 | @@ -496,7 +496,7 @@ | |
14 | logit(log_file, "DEBUG No squidguard and no antivir check (TRUSTUSER match) for user: %s\n", in_buff.ident); | |
15 | if (statit == 1) | |
16 | timeit(g_start, "Total"); | |
17 | - puts(""); | |
18 | + puts("ERR message=\"TRUSTUSER match\""); | |
19 | fflush(stdout); | |
20 | continue; | |
21 | } | |
22 | @@ -508,7 +508,7 @@ | |
23 | logit(log_file, "DEBUG No squidguard and no antivir check (TRUSTCLIENT match) for address: %s/%s\n",in_buff.ipaddress, in_buff.fqdn); | |
24 | if (statit == 1) | |
25 | timeit(g_start, "Total"); | |
26 | - puts(""); | |
27 | + puts("ERR message=\"TRUSTCLIENT match\""); | |
28 | fflush(stdout); | |
29 | continue; | |
30 | } | |
31 | @@ -520,7 +520,7 @@ | |
32 | logit(log_file, "DEBUG No squidguard and no antivir check (WHITELIST match) for url: %s\n", in_buff.url); | |
33 | if (statit == 1) | |
34 | timeit(g_start, "Total"); | |
35 | - puts(""); | |
36 | + puts("ERR message=\"WHITLIST match\""); | |
37 | fflush(stdout); | |
38 | continue; | |
39 | } | |
40 | @@ -536,7 +536,7 @@ | |
41 | if ((sockd = dconnect ()) < 0) | |
42 | { | |
43 | logit(log_file, "ERROR Can't connect to Clamd daemon, fallback to Squid.\n"); | |
44 | - puts(""); | |
45 | + puts("BH message=\"Cannot connect to clamd\""); | |
46 | fflush(stdout); | |
47 | continue; | |
48 | } | |
49 | @@ -546,7 +546,7 @@ | |
50 | if (write (sockd, "zINSTREAM", 10) <= 0) | |
51 | { | |
52 | logit(log_file, "ERROR Can't write to Clamd socket.\n"); | |
53 | - puts(""); | |
54 | + puts("BG message=\"Cannot write to clamd socket\""); | |
55 | fflush(stdout); | |
56 | continue; | |
57 | } | |
58 | @@ -614,8 +614,7 @@ | |
59 | logit(log_file, "Squid Cache purged of url %s.\n", in_buff.url); | |
60 | } | |
61 | } | |
62 | - fprintf (stdout, "%s %s %s %s\n", urlredir, | |
63 | - in_buff.src_address, in_buff.ident, in_buff.method); | |
a545f88e | 64 | + fprintf (stdout, "OK rewrite-url=\"%s\"\n", urlredir); |
ccf1cb25 MT |
65 | fflush(stdout); |
66 | xfree(urlredir); | |
67 | if (debug != 0) | |
68 | @@ -675,7 +674,7 @@ | |
69 | continue operation (so that Squid still works!), | |
70 | we simply echo stdin to stdout - i.e. "bridge mode" :-) */ | |
71 | if (bridge_mode == 1) { | |
72 | - puts(""); | |
73 | + puts("ERR message=\"brigde mode\""); | |
74 | fflush(stdout); | |
75 | continue; | |
76 | } | |
77 | @@ -685,7 +684,7 @@ | |
78 | if (buff_status == -1) { | |
79 | if (debug > 2) | |
80 | logit(log_file, "DEBUG method is not GET skipping virus scan.\n"); | |
81 | - puts(""); | |
82 | + puts("ERR message=\"method is not GET skipping virus scan\""); | |
83 | fflush(stdout); | |
84 | continue; | |
85 | } | |
86 | @@ -699,7 +698,7 @@ | |
87 | timeit(g_start, "Total"); | |
88 | ||
89 | /* no replacement for the URL was found */ | |
90 | - puts(""); | |
91 | + puts("ERR message=\"ABORT match\""); | |
92 | fflush(stdout); | |
93 | continue; | |
94 | ||
95 | @@ -750,7 +749,7 @@ | |
96 | logit(log_file, "DEBUG HIT Cache found, trust cache enabled, skipping...\n"); | |
97 | if (statit == 1) | |
98 | timeit(g_start, "Total"); | |
99 | - puts(""); | |
100 | + puts("ERR message=\"cache hit found\""); | |
101 | fflush(stdout); | |
102 | continue; | |
103 | } | |
104 | @@ -762,7 +761,7 @@ | |
105 | logit(log_file, "ERROR No content length from url %s\n", in_buff.url); | |
106 | if (statit == 1) | |
107 | timeit(g_start, "Total"); | |
108 | - puts(""); | |
109 | + puts("ERR message=\"no content length from URL\""); | |
110 | fflush(stdout); | |
111 | continue; | |
112 | } | |
113 | @@ -775,7 +774,7 @@ | |
114 | logit(log_file, "DEBUG No antivir check (Content length is upper than maxsize): %'.2f > %'.2f\n", usize, maxsize); | |
115 | if (statit == 1) | |
116 | timeit(g_start, "Total"); | |
117 | - puts(""); | |
118 | + puts("ERR message=\"content length is upper than maxsize\""); | |
119 | fflush(stdout); | |
120 | continue; | |
121 | } | |
122 | @@ -787,7 +786,7 @@ | |
123 | in_buff.url); | |
124 | if (statit == 1) | |
125 | timeit(g_start, "Total"); | |
126 | - puts(""); | |
127 | + puts("ERR message=\"no content type from URL\""); | |
128 | fflush(stdout); | |
129 | continue; | |
130 | } | |
131 | @@ -799,7 +798,7 @@ | |
132 | logit(log_file, "DEBUG No antivir check (ABORTCONTENT match) for content-type: %s\n", content_type); | |
133 | if (statit == 1) | |
134 | timeit(g_start, "Total"); | |
135 | - puts(""); | |
136 | + puts("ERR message=\"ABORTCONTENT match\""); | |
137 | fflush(stdout); | |
138 | continue; | |
139 | } | |
140 | @@ -814,7 +813,7 @@ | |
141 | if ((sockd = dconnect ()) < 0) | |
142 | { | |
143 | logit(log_file, "ERROR Can't connect to Clamd daemon, fallback to Squid.\n"); | |
144 | - puts(""); | |
145 | + puts("BH message=\"cannot connect clamd daemon\""); | |
146 | fflush(stdout); | |
147 | continue; | |
148 | } | |
149 | @@ -824,7 +823,7 @@ | |
150 | if (write (sockd, "zINSTREAM", 10) <= 0) | |
151 | { | |
152 | logit(log_file, "ERROR Can't write to Clamd socket.\n"); | |
153 | - puts(""); | |
154 | + puts("BH message=\"cannot write to clamd socket\""); | |
155 | fflush(stdout); | |
156 | continue; | |
157 | } | |
158 | @@ -844,7 +843,7 @@ | |
159 | close (sockd); | |
160 | if (debug > 1) | |
161 | logit(log_file, "DEBUG Connection to clamd closed.\n"); | |
162 | - puts(""); | |
163 | + puts("ERR message=\"connection to clamd closed\""); | |
164 | fflush(stdout); | |
165 | if (statit == 1) | |
166 | timeit(g_start, "Total"); | |
167 | @@ -892,8 +891,7 @@ | |
168 | logit(log_file, "Squid Cache purged of url %s.\n", in_buff.url); | |
169 | } | |
170 | } | |
171 | - fprintf (stdout, "%s %s %s %s\n", urlredir, | |
172 | - in_buff.src_address, in_buff.ident, in_buff.method); | |
a545f88e | 173 | + fprintf (stdout, "OK rewrite-url=\"%s\"\n", urlredir); |
ccf1cb25 MT |
174 | fflush(stdout); |
175 | xfree(urlredir); | |
176 | if (debug != 0) | |
177 | @@ -911,7 +909,7 @@ | |
178 | if (virusfound == 0) { | |
179 | if (debug != 0) | |
180 | logit(log_file, "DEBUG No virus detected.\n"); | |
181 | - puts(""); | |
182 | + puts("ERR message=\"no virus detected\""); | |
183 | fflush(stdout); | |
184 | } | |
185 | } |