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
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);
9 + puts("BH message=\"Invalid input buffer\"");
14 logit(log_file, "DEBUG No squidguard and no antivir check (TRUSTUSER match) for user: %s\n", in_buff.ident);
16 timeit(g_start, "Total");
18 + puts("ERR message=\"TRUSTUSER match\"");
23 logit(log_file, "DEBUG No squidguard and no antivir check (TRUSTCLIENT match) for address: %s/%s\n",in_buff.ipaddress, in_buff.fqdn);
25 timeit(g_start, "Total");
27 + puts("ERR message=\"TRUSTCLIENT match\"");
32 logit(log_file, "DEBUG No squidguard and no antivir check (WHITELIST match) for url: %s\n", in_buff.url);
34 timeit(g_start, "Total");
36 + puts("ERR message=\"WHITLIST match\"");
41 if ((sockd = dconnect ()) < 0)
43 logit(log_file, "ERROR Can't connect to Clamd daemon, fallback to Squid.\n");
45 + puts("BH message=\"Cannot connect to clamd\"");
50 if (write (sockd, "zINSTREAM", 10) <= 0)
52 logit(log_file, "ERROR Can't write to Clamd socket.\n");
54 + puts("BG message=\"Cannot write to clamd socket\"");
59 logit(log_file, "Squid Cache purged of url %s.\n", in_buff.url);
62 - fprintf (stdout, "%s %s %s %s\n", urlredir,
63 - in_buff.src_address, in_buff.ident, in_buff.method);
64 + fprintf (stdout, "OK rewrite-url=\"%s\"\n", urlredir);
69 continue operation (so that Squid still works!),
70 we simply echo stdin to stdout - i.e. "bridge mode" :-) */
71 if (bridge_mode == 1) {
73 + puts("ERR message=\"brigde mode\"");
78 if (buff_status == -1) {
80 logit(log_file, "DEBUG method is not GET skipping virus scan.\n");
82 + puts("ERR message=\"method is not GET skipping virus scan\"");
87 timeit(g_start, "Total");
89 /* no replacement for the URL was found */
91 + puts("ERR message=\"ABORT match\"");
96 logit(log_file, "DEBUG HIT Cache found, trust cache enabled, skipping...\n");
98 timeit(g_start, "Total");
100 + puts("ERR message=\"cache hit found\"");
105 logit(log_file, "ERROR No content length from url %s\n", in_buff.url);
107 timeit(g_start, "Total");
109 + puts("ERR message=\"no content length from URL\"");
114 logit(log_file, "DEBUG No antivir check (Content length is upper than maxsize): %'.2f > %'.2f\n", usize, maxsize);
116 timeit(g_start, "Total");
118 + puts("ERR message=\"content length is upper than maxsize\"");
125 timeit(g_start, "Total");
127 + puts("ERR message=\"no content type from URL\"");
132 logit(log_file, "DEBUG No antivir check (ABORTCONTENT match) for content-type: %s\n", content_type);
134 timeit(g_start, "Total");
136 + puts("ERR message=\"ABORTCONTENT match\"");
141 if ((sockd = dconnect ()) < 0)
143 logit(log_file, "ERROR Can't connect to Clamd daemon, fallback to Squid.\n");
145 + puts("BH message=\"cannot connect clamd daemon\"");
150 if (write (sockd, "zINSTREAM", 10) <= 0)
152 logit(log_file, "ERROR Can't write to Clamd socket.\n");
154 + puts("BH message=\"cannot write to clamd socket\"");
161 logit(log_file, "DEBUG Connection to clamd closed.\n");
163 + puts("ERR message=\"connection to clamd closed\"");
166 timeit(g_start, "Total");
168 logit(log_file, "Squid Cache purged of url %s.\n", in_buff.url);
171 - fprintf (stdout, "%s %s %s %s\n", urlredir,
172 - in_buff.src_address, in_buff.ident, in_buff.method);
173 + fprintf (stdout, "OK rewrite-url=\"%s\"\n", urlredir);
178 if (virusfound == 0) {
180 logit(log_file, "DEBUG No virus detected.\n");
182 + puts("ERR message=\"no virus detected\"");