Imported Debian patch 2.23.05-1
[hcoop/zz_old/debian/webalizer.git] / debian / patches / 06_apache_logio_optional.diff
1 From: Julien Viard de Galbert <julien@vdg.blogsite.org>
2 Date: Wed, 24 Nov 2010 16:13:52 +0100
3 Subject: [PATCH] Make logio optional
4
5 This patch adds a InOutKb option to make the In/Out KByte data optional.
6 You mush apply the apache_logio patch prior to applying this patch.
7 ---
8 graphs.c | 171 ++++++++++------
9 output.c | 654 +++++++++++++++++++++++++++++++++++++----------------------
10 sample.conf | 11 +
11 webalizer.c | 22 ++-
12 webalizer.h | 1 +
13 5 files changed, 552 insertions(+), 307 deletions(-)
14
15 Index: webalizer/graphs.c
16 ===================================================================
17 --- webalizer.orig/graphs.c 2011-01-08 20:59:30.000000000 +0100
18 +++ webalizer/graphs.c 2011-01-08 20:59:32.000000000 +0100
19 @@ -141,6 +141,15 @@
20 {
21 /* Kbytes Legend */
22 i = (strlen(msg_h_xfer)*6);
23 + if (dump_inout == 0)
24 + {
25 + gdImageString(im,gdFontSmall,491-i,237,
26 + (unsigned char *)msg_h_xfer,dkgrey);
27 + gdImageString(im,gdFontSmall,490-i,236,
28 + (unsigned char *)msg_h_xfer,KBYTECOLOR);
29 + }
30 + else
31 + {
32 j = (strlen(msg_h_ixfer)*6);
33 k = (strlen(msg_h_oxfer)*6);
34 gdImageString(im,gdFontSmall,491-i-j-k-24,237,
35 @@ -159,7 +168,7 @@
36 (unsigned char *)msg_h_oxfer,dkgrey);
37 gdImageString(im,gdFontSmall,490-k,236,
38 (unsigned char *)msg_h_oxfer,OKBYTECOLOR);
39 -
40 + }
41 /* Sites/Visits Legend */
42 i = (strlen(msg_h_visits)*6);
43 j = (strlen(msg_h_sites)*6);
44 @@ -321,17 +330,30 @@
45 fmaxval=0.0;
46 for (i=s_mth; i<HISTSIZE; i++){
47 if (data[i].xfer > fmaxval) fmaxval = data[i].xfer;
48 - if (data[i].ixfer > fmaxval) fmaxval = data[i].ixfer;
49 - if (data[i].oxfer > fmaxval) fmaxval = data[i].oxfer;
50 + if (dump_inout != 0)
51 + {
52 + if (data[i].ixfer > fmaxval) fmaxval = data[i].ixfer;
53 + if (data[i].oxfer > fmaxval) fmaxval = data[i].oxfer;
54 + }
55 }
56 if (fmaxval <= 0.0) fmaxval = 1.0;
57 sprintf(maxvaltxt, "%.0f", fmaxval);
58 gdImageStringUp(im, gdFontSmall,493,130+(strlen(maxvaltxt)*6),
59 (unsigned char *)maxvaltxt,black);
60
61 - cs = 180.0/graph_mths; cw = (cs/2);
62 - co = (36/graph_mths<1)?1:36/graph_mths;
63 - ci = 308+((cw-2*co)/2);
64 + cs = 180.0/graph_mths;
65 + if (dump_inout == 0)
66 + {
67 + co = (48/graph_mths<1)?1:48/graph_mths;
68 + cw = (cs/2)+(co/2);
69 + ci = 308+((cw-co)/2);
70 + }
71 + else
72 + {
73 + co = (36/graph_mths<1)?1:36/graph_mths;
74 + cw = (cs/2);
75 + ci = 308+((cw-2*co)/2);
76 + }
77
78 /* xfer */
79 for (i=s_mth; i<HISTSIZE; i++)
80 @@ -345,28 +367,31 @@
81 if (cw>2) gdImageRectangle(im, x1, y1, x2, 232, black);
82 }
83
84 - /* ixfer */
85 - for (i=s_mth; i<HISTSIZE; i++)
86 + if (dump_inout != 0)
87 {
88 - percent = ((float)data[i].ixfer / (float)fmaxval);
89 - if (percent <= 0.0) continue;
90 - x1 = ci + co + ((i-s_mth)*cs);
91 - x2 = x1 + cw;
92 - y1 = 232 - (percent * 98);
93 - gdImageFilledRectangle(im, x1, y1, x2, 232, IKBYTECOLOR);
94 - if (cw>2) gdImageRectangle(im, x1, y1, x2, 232, black);
95 - }
96 + /* ixfer */
97 + for (i=s_mth; i<HISTSIZE; i++)
98 + {
99 + percent = ((float)data[i].ixfer / (float)fmaxval);
100 + if (percent <= 0.0) continue;
101 + x1 = ci + co + ((i-s_mth)*cs);
102 + x2 = x1 + cw;
103 + y1 = 232 - (percent * 98);
104 + gdImageFilledRectangle(im, x1, y1, x2, 232, IKBYTECOLOR);
105 + if (cw>2) gdImageRectangle(im, x1, y1, x2, 232, black);
106 + }
107
108 - /* oxfer */
109 - for (i=s_mth; i<HISTSIZE; i++)
110 - {
111 - percent = ((float)data[i].oxfer / (float)fmaxval);
112 - if (percent <= 0.0) continue;
113 - x1 = ci + co + co + ((i-s_mth)*cs);
114 - x2 = x1 + cw;
115 - y1 = 232 - (percent * 98);
116 - gdImageFilledRectangle(im, x1, y1, x2, 232, OKBYTECOLOR);
117 - if (cw>2) gdImageRectangle(im, x1, y1, x2, 232, black);
118 + /* oxfer */
119 + for (i=s_mth; i<HISTSIZE; i++)
120 + {
121 + percent = ((float)data[i].oxfer / (float)fmaxval);
122 + if (percent <= 0.0) continue;
123 + x1 = ci + co + co + ((i-s_mth)*cs);
124 + x2 = x1 + cw;
125 + y1 = 232 - (percent * 98);
126 + gdImageFilledRectangle(im, x1, y1, x2, 232, OKBYTECOLOR);
127 + if (cw>2) gdImageRectangle(im, x1, y1, x2, 232, black);
128 + }
129 }
130
131 /* stat the file */
132 @@ -471,24 +496,27 @@
133 if (graph_legend) /* Print color coded legends? */
134 {
135 /* Kbytes Legend */
136 - i=(strlen(msg_h_xfer)*6);
137 - j=(strlen(msg_h_ixfer)*6);
138 gdImageStringUp(im,gdFontSmall,494,376,
139 (unsigned char *)msg_h_xfer,dkgrey);
140 gdImageStringUp(im,gdFontSmall,493,375,
141 (unsigned char *)msg_h_xfer,KBYTECOLOR);
142 - gdImageStringUp(im,gdFontSmall,494,376-i-3,"/",dkgrey);
143 - gdImageStringUp(im,gdFontSmall,493,375-i-3,"/",black);
144 - gdImageStringUp(im,gdFontSmall,494,376-i-12,
145 - (unsigned char *)msg_h_ixfer,dkgrey);
146 - gdImageStringUp(im,gdFontSmall,493,375-i-12,
147 - (unsigned char *)msg_h_ixfer,IKBYTECOLOR);
148 - gdImageStringUp(im,gdFontSmall,494,376-i-j-15,"/",dkgrey);
149 - gdImageStringUp(im,gdFontSmall,493,375-i-j-15,"/",black);
150 - gdImageStringUp(im,gdFontSmall,494,376-i-j-24,
151 - (unsigned char *)msg_h_oxfer,dkgrey);
152 - gdImageStringUp(im,gdFontSmall,493,375-i-j-24,
153 - (unsigned char *)msg_h_oxfer,OKBYTECOLOR);
154 + if (dump_inout != 0)
155 + {
156 + i=(strlen(msg_h_xfer)*6);
157 + j=(strlen(msg_h_ixfer)*6);
158 + gdImageStringUp(im,gdFontSmall,494,376-i-3,"/",dkgrey);
159 + gdImageStringUp(im,gdFontSmall,493,375-i-3,"/",black);
160 + gdImageStringUp(im,gdFontSmall,494,376-i-12,
161 + (unsigned char *)msg_h_ixfer,dkgrey);
162 + gdImageStringUp(im,gdFontSmall,493,375-i-12,
163 + (unsigned char *)msg_h_ixfer,IKBYTECOLOR);
164 + gdImageStringUp(im,gdFontSmall,494,376-i-j-15,"/",dkgrey);
165 + gdImageStringUp(im,gdFontSmall,493,375-i-j-15,"/",black);
166 + gdImageStringUp(im,gdFontSmall,494,376-i-j-24,
167 + (unsigned char *)msg_h_oxfer,dkgrey);
168 + gdImageStringUp(im,gdFontSmall,493,375-i-j-24,
169 + (unsigned char *)msg_h_oxfer,OKBYTECOLOR);
170 + }
171
172 /* Sites/Visits Legend */
173 i = (strlen(msg_h_sites)*6);
174 @@ -602,8 +630,11 @@
175 fmaxval=0.0;
176 for (i=0; i<31; i++){
177 if (data4[i]>fmaxval) fmaxval = data4[i];
178 - if (data5[i]>fmaxval) fmaxval = data5[i];
179 - if (data6[i]>fmaxval) fmaxval = data6[i];
180 + if (dump_inout != 0)
181 + {
182 + if (data5[i]>fmaxval) fmaxval = data5[i];
183 + if (data6[i]>fmaxval) fmaxval = data6[i];
184 + }
185 }
186 if (fmaxval <= 0.0) fmaxval = 1.0;
187 sprintf(maxvaltxt, "%.0f", fmaxval/1024);
188 @@ -615,38 +646,48 @@
189 {
190 percent = data4[i] / fmaxval;
191 if (percent <= 0.0) continue;
192 - x1 = 25 + (i*15);
193 - x2 = x1 + 7;
194 + if (dump_inout == 0)
195 + {
196 + x1 = 26 + (i*15);
197 + x2 = x1 + 10;
198 + }
199 + else
200 + {
201 + x1 = 25 + (i*15);
202 + x2 = x1 + 7;
203 + }
204 y1 = 375 - ( percent * 91 );
205 gdImageFilledRectangle(im, x1, y1, x2, 375, KBYTECOLOR);
206 gdImageRectangle(im, x1, y1, x2, 375, black);
207 }
208
209 - /* data5 */
210 - for (i=0; i<31; i++)
211 + if (dump_inout != 0)
212 {
213 - percent = data5[i] / fmaxval;
214 - if (percent <= 0.0) continue;
215 - x1 = 27 + (i*15);
216 - x2 = x1 + 7;
217 - y1 = 375 - ( percent * 91 );
218 - gdImageFilledRectangle(im, x1, y1, x2, 375, IKBYTECOLOR);
219 - gdImageRectangle(im, x1, y1, x2, 375, black);
220 - }
221 + /* data5 */
222 + for (i=0; i<31; i++)
223 + {
224 + percent = data5[i] / fmaxval;
225 + if (percent <= 0.0) continue;
226 + x1 = 27 + (i*15);
227 + x2 = x1 + 7;
228 + y1 = 375 - ( percent * 91 );
229 + gdImageFilledRectangle(im, x1, y1, x2, 375, IKBYTECOLOR);
230 + gdImageRectangle(im, x1, y1, x2, 375, black);
231 + }
232
233 - /* data6 */
234 - for (i=0; i<31; i++)
235 - {
236 - percent = data6[i] / fmaxval;
237 - if (percent <= 0.0) continue;
238 - x1 = 29 + (i*15);
239 - x2 = x1 + 7;
240 - y1 = 375 - ( percent * 91 );
241 - gdImageFilledRectangle(im, x1, y1, x2, 375, OKBYTECOLOR);
242 - gdImageRectangle(im, x1, y1, x2, 375, black);
243 + /* data6 */
244 + for (i=0; i<31; i++)
245 + {
246 + percent = data6[i] / fmaxval;
247 + if (percent <= 0.0) continue;
248 + x1 = 29 + (i*15);
249 + x2 = x1 + 7;
250 + y1 = 375 - ( percent * 91 );
251 + gdImageFilledRectangle(im, x1, y1, x2, 375, OKBYTECOLOR);
252 + gdImageRectangle(im, x1, y1, x2, 375, black);
253 + }
254 }
255
256 -
257 /* stat the file */
258 if ( !(lstat(fname, &out_stat)) )
259 {
260 Index: webalizer/output.c
261 ===================================================================
262 --- webalizer.orig/output.c 2011-01-08 20:59:30.000000000 +0100
263 +++ webalizer/output.c 2011-01-08 20:59:32.000000000 +0100
264 @@ -549,12 +549,15 @@
265 fprintf(out_fp,"<TR><TD WIDTH=380><FONT SIZE=\"-1\">%s</FONT></TD>\n" \
266 "<TD ALIGN=right COLSPAN=2><FONT SIZE=\"-1\"><B>%.0f</B>" \
267 "</FONT></TD></TR>\n",msg_mtot_tx,t_xfer/1024);
268 - fprintf(out_fp,"<TR><TD WIDTH=380><FONT SIZE=\"-1\">%s</FONT></TD>\n" \
269 - "<TD ALIGN=right COLSPAN=2><FONT SIZE=\"-1\"><B>%.0f</B>" \
270 - "</FONT></TD></TR>\n",msg_mtot_ix,t_ixfer/1024);
271 - fprintf(out_fp,"<TR><TD WIDTH=380><FONT SIZE=\"-1\">%s</FONT></TD>\n" \
272 - "<TD ALIGN=right COLSPAN=2><FONT SIZE=\"-1\"><B>%.0f</B>" \
273 - "</FONT></TD></TR>\n",msg_mtot_ox,t_oxfer/1024);
274 + if (dump_inout != 0)
275 + {
276 + fprintf(out_fp,"<TR><TD WIDTH=380><FONT SIZE=\"-1\">%s</FONT></TD>\n" \
277 + "<TD ALIGN=right COLSPAN=2><FONT SIZE=\"-1\"><B>%.0f</B>" \
278 + "</FONT></TD></TR>\n",msg_mtot_ix,t_ixfer/1024);
279 + fprintf(out_fp,"<TR><TD WIDTH=380><FONT SIZE=\"-1\">%s</FONT></TD>\n" \
280 + "<TD ALIGN=right COLSPAN=2><FONT SIZE=\"-1\"><B>%.0f</B>" \
281 + "</FONT></TD></TR>\n",msg_mtot_ox,t_oxfer/1024);
282 + }
283 fprintf(out_fp,"<TR><TH HEIGHT=4></TH></TR>\n");
284 /**********************************************/
285 /* Unique Sites */
286 @@ -639,18 +642,21 @@
287 "<TD WIDTH=65 ALIGN=right><FONT SIZE=-1><B>%.0f</B>" \
288 "</FONT></TD></TR>\n",msg_mtot_mkd,
289 (t_xfer/1024)/days_in_month,max_xfer/1024);
290 - fprintf(out_fp,"<TR>" \
291 - "<TD><FONT SIZE=\"-1\">%s</FONT></TD>\n" \
292 - "<TD ALIGN=right WIDTH=65><FONT SIZE=\"-1\"><B>%.0f</B></FONT></TD>\n" \
293 - "<TD WIDTH=65 ALIGN=right><FONT SIZE=-1><B>%.0f</B>" \
294 - "</FONT></TD></TR>\n",msg_mtot_ikd,
295 - (t_ixfer/1024)/days_in_month,max_ixfer/1024);
296 - fprintf(out_fp,"<TR>" \
297 - "<TD><FONT SIZE=\"-1\">%s</FONT></TD>\n" \
298 - "<TD ALIGN=right WIDTH=65><FONT SIZE=\"-1\"><B>%.0f</B></FONT></TD>\n" \
299 - "<TD WIDTH=65 ALIGN=right><FONT SIZE=-1><B>%.0f</B>" \
300 - "</FONT></TD></TR>\n",msg_mtot_okd,
301 - (t_oxfer/1024)/days_in_month,max_oxfer/1024);
302 + if (dump_inout != 0)
303 + {
304 + fprintf(out_fp,"<TR>" \
305 + "<TD><FONT SIZE=\"-1\">%s</FONT></TD>\n" \
306 + "<TD ALIGN=right WIDTH=65><FONT SIZE=\"-1\"><B>%.0f</B></FONT></TD>\n" \
307 + "<TD WIDTH=65 ALIGN=right><FONT SIZE=-1><B>%.0f</B>" \
308 + "</FONT></TD></TR>\n",msg_mtot_ikd,
309 + (t_ixfer/1024)/days_in_month,max_ixfer/1024);
310 + fprintf(out_fp,"<TR>" \
311 + "<TD><FONT SIZE=\"-1\">%s</FONT></TD>\n" \
312 + "<TD ALIGN=right WIDTH=65><FONT SIZE=\"-1\"><B>%.0f</B></FONT></TD>\n" \
313 + "<TD WIDTH=65 ALIGN=right><FONT SIZE=-1><B>%.0f</B>" \
314 + "</FONT></TD></TR>\n",msg_mtot_okd,
315 + (t_oxfer/1024)/days_in_month,max_oxfer/1024);
316 + }
317 fprintf(out_fp,"<TR><TH HEIGHT=4></TH></TR>\n");
318 /**********************************************/
319 /* response code totals */
320 @@ -684,9 +690,9 @@
321 fprintf(out_fp,"<TABLE WIDTH=510 BORDER=2 CELLSPACING=1 CELLPADDING=1>\n");
322 fprintf(out_fp,"<TR><TH HEIGHT=4></TH></TR>\n");
323 /* Daily statistics for ... */
324 - fprintf(out_fp,"<TR><TH BGCOLOR=\"%s\" COLSPAN=17 ALIGN=center>" \
325 + fprintf(out_fp,"<TR><TH BGCOLOR=\"%s\" COLSPAN=%d ALIGN=center>" \
326 "%s %s %d</TH></TR>\n",
327 - GREY,msg_dtot_ds,l_month[cur_month-1], cur_year);
328 + GREY,(dump_inout==0)?13:17,msg_dtot_ds,l_month[cur_month-1], cur_year);
329 fprintf(out_fp,"<TR><TH HEIGHT=4></TH></TR>\n");
330 fprintf(out_fp,"<TR><TH ALIGN=center BGCOLOR=\"%s\">" \
331 "<FONT SIZE=\"-1\">%s</FONT></TH>\n" \
332 @@ -701,20 +707,28 @@
333 "<TH ALIGN=center BGCOLOR=\"%s\" COLSPAN=2>" \
334 "<FONT SIZE=\"-1\">%s</FONT></TH>\n" \
335 "<TH ALIGN=center BGCOLOR=\"%s\" COLSPAN=2>" \
336 - "<FONT SIZE=\"-1\">%s</FONT></TH>\n" \
337 - "<TH ALIGN=center BGCOLOR=\"%s\" COLSPAN=2>" \
338 - "<FONT SIZE=\"-1\">%s</FONT></TH>\n" \
339 - "<TH ALIGN=center BGCOLOR=\"%s\" COLSPAN=2>" \
340 - "<FONT SIZE=\"-1\">%s</FONT></TH></TR>\n",
341 + "<FONT SIZE=\"-1\">%s</FONT></TH>",
342 GREY, msg_h_day,
343 HITCOLOR, msg_h_hits,
344 FILECOLOR, msg_h_files,
345 PAGECOLOR, msg_h_pages,
346 VISITCOLOR, msg_h_visits,
347 SITECOLOR, msg_h_sites,
348 - KBYTECOLOR, msg_h_xfer,
349 - LTBLUE, msg_h_ixfer,
350 - GREEN, msg_h_oxfer);
351 + KBYTECOLOR, msg_h_xfer);
352 + if (dump_inout == 0)
353 + {
354 + fprintf(out_fp,"</TR>\n");
355 + }
356 + else
357 + {
358 + fprintf(out_fp,"\n" \
359 + "<TH ALIGN=center BGCOLOR=\"%s\" COLSPAN=2>" \
360 + "<FONT SIZE=\"-1\">%s</FONT></TH>\n" \
361 + "<TH ALIGN=center BGCOLOR=\"%s\" COLSPAN=2>" \
362 + "<FONT SIZE=\"-1\">%s</FONT></TH></TR>\n",
363 + LTBLUE, msg_h_ixfer,
364 + GREEN, msg_h_oxfer);
365 + }
366 fprintf(out_fp,"<TR><TH HEIGHT=4></TH></TR>\n");
367
368 /* skip beginning blank days in a month */
369 @@ -750,16 +764,24 @@
370 tm_site[i],PCENT(tm_site[i],t_site));
371 fprintf(out_fp,"<TD ALIGN=right>" \
372 "<FONT SIZE=\"-1\"><B>%.0f</B></FONT></TD>\n" \
373 - "<TD ALIGN=right><FONT SIZE=\"-2\">%3.02f%%</FONT></TD>\n",
374 + "<TD ALIGN=right><FONT SIZE=\"-2\">%3.02f%%</FONT></TD>",
375 tm_xfer[i]/1024,PCENT(tm_xfer[i],t_xfer));
376 - fprintf(out_fp,"<TD ALIGN=right>" \
377 - "<FONT SIZE=\"-1\"><B>%.0f</B></FONT></TD>\n" \
378 - "<TD ALIGN=right><FONT SIZE=\"-2\">%3.02f%%</FONT></TD>\n",
379 - tm_ixfer[i]/1024,PCENT(tm_ixfer[i],t_ixfer));
380 - fprintf(out_fp,"<TD ALIGN=right>" \
381 - "<FONT SIZE=\"-1\"><B>%.0f</B></FONT></TD>\n" \
382 - "<TD ALIGN=right><FONT SIZE=\"-2\">%3.02f%%</FONT></TD></TR>\n",
383 - tm_oxfer[i]/1024,PCENT(tm_oxfer[i],t_oxfer));
384 + if (dump_inout == 0)
385 + {
386 + fprintf(out_fp,"</TR>\n");
387 + }
388 + else
389 + {
390 + fprintf(out_fp,"\n" \
391 + "<TD ALIGN=right>" \
392 + "<FONT SIZE=\"-1\"><B>%.0f</B></FONT></TD>\n" \
393 + "<TD ALIGN=right><FONT SIZE=\"-2\">%3.02f%%</FONT></TD>\n",
394 + tm_ixfer[i]/1024,PCENT(tm_ixfer[i],t_ixfer));
395 + fprintf(out_fp,"<TD ALIGN=right>" \
396 + "<FONT SIZE=\"-1\"><B>%.0f</B></FONT></TD>\n" \
397 + "<TD ALIGN=right><FONT SIZE=\"-2\">%3.02f%%</FONT></TD></TR>\n",
398 + tm_oxfer[i]/1024,PCENT(tm_oxfer[i],t_oxfer));
399 + }
400 }
401 fprintf(out_fp,"<TR><TH HEIGHT=4></TH></TR>\n");
402 fprintf(out_fp,"</TABLE>\n");
403 @@ -781,9 +803,9 @@
404 /* Hourly stats */
405 fprintf(out_fp,"<TABLE WIDTH=510 BORDER=2 CELLSPACING=1 CELLPADDING=1>\n");
406 fprintf(out_fp,"<TR><TH HEIGHT=4></TH></TR>\n");
407 - fprintf(out_fp,"<TR><TH BGCOLOR=\"%s\" COLSPAN=19 ALIGN=center>"\
408 + fprintf(out_fp,"<TR><TH BGCOLOR=\"%s\" COLSPAN=%d ALIGN=center>"\
409 "%s %s %d</TH></TR>\n",
410 - GREY,msg_htot_hs,l_month[cur_month-1], cur_year);
411 + GREY,(dump_inout==0)?13:19,msg_htot_hs,l_month[cur_month-1], cur_year);
412 fprintf(out_fp,"<TR><TH HEIGHT=4></TH></TR>\n");
413 fprintf(out_fp,"<TR><TH ALIGN=center ROWSPAN=2 BGCOLOR=\"%s\">" \
414 "<FONT SIZE=\"-1\">%s</FONT></TH>\n" \
415 @@ -794,18 +816,26 @@
416 "<TH ALIGN=center BGCOLOR=\"%s\" COLSPAN=3>" \
417 "<FONT SIZE=\"-1\">%s</FONT></TH>\n" \
418 "<TH ALIGN=center BGCOLOR=\"%s\" COLSPAN=3>" \
419 - "<FONT SIZE=\"-1\">%s</FONT></TH>\n" \
420 - "<TH ALIGN=center BGCOLOR=\"%s\" COLSPAN=3>" \
421 - "<FONT SIZE=\"-1\">%s</FONT></TH>\n" \
422 - "<TH ALIGN=center BGCOLOR=\"%s\" COLSPAN=3>" \
423 - "<FONT SIZE=\"-1\">%s</FONT></TH></TR>\n",
424 + "<FONT SIZE=\"-1\">%s</FONT></TH>",
425 GREY, msg_h_hour,
426 HITCOLOR, msg_h_hits,
427 FILECOLOR, msg_h_files,
428 PAGECOLOR, msg_h_pages,
429 - KBYTECOLOR, msg_h_xfer,
430 - LTBLUE, msg_h_ixfer,
431 - GREEN, msg_h_oxfer);
432 + KBYTECOLOR, msg_h_xfer);
433 + if (dump_inout == 0)
434 + {
435 + fprintf(out_fp,"</TR>\n");
436 + }
437 + else
438 + {
439 + fprintf(out_fp,"\n" \
440 + "<TH ALIGN=center BGCOLOR=\"%s\" COLSPAN=3>" \
441 + "<FONT SIZE=\"-1\">%s</FONT></TH>\n" \
442 + "<TH ALIGN=center BGCOLOR=\"%s\" COLSPAN=3>" \
443 + "<FONT SIZE=\"-1\">%s</FONT></TH></TR>\n",
444 + LTBLUE, msg_h_ixfer,
445 + GREEN, msg_h_oxfer);
446 + }
447 fprintf(out_fp,"<TR><TH ALIGN=center BGCOLOR=\"%s\">" \
448 "<FONT SIZE=\"-2\">%s</FONT></TH>\n" \
449 "<TH ALIGN=center BGCOLOR=\"%s\" COLSPAN=2>" \
450 @@ -824,18 +854,26 @@
451 fprintf(out_fp,"<TH ALIGN=center BGCOLOR=\"%s\">" \
452 "<FONT SIZE=\"-2\">%s</FONT></TH>\n" \
453 "<TH ALIGN=center BGCOLOR=\"%s\" COLSPAN=2>" \
454 - "<FONT SIZE=\"-2\">%s</FONT></TH>\n",
455 + "<FONT SIZE=\"-2\">%s</FONT>",
456 KBYTECOLOR, msg_h_avg, KBYTECOLOR, msg_h_total);
457 - fprintf(out_fp,"<TH ALIGN=center BGCOLOR=\"%s\">" \
458 - "<FONT SIZE=\"-2\">%s</FONT></TH>\n" \
459 - "<TH ALIGN=center BGCOLOR=\"%s\" COLSPAN=2>" \
460 - "<FONT SIZE=\"-2\">%s</FONT></TH>\n",
461 - LTBLUE, msg_h_avg, LTBLUE, msg_h_total);
462 - fprintf(out_fp,"<TH ALIGN=center BGCOLOR=\"%s\">" \
463 - "<FONT SIZE=\"-2\">%s</FONT></TH>\n" \
464 - "<TH ALIGN=center BGCOLOR=\"%s\" COLSPAN=2>" \
465 - "<FONT SIZE=\"-2\">%s</FONT></TH></TR>\n",
466 - GREEN, msg_h_avg, GREEN, msg_h_total);
467 + if (dump_inout == 0)
468 + {
469 + fprintf(out_fp,"</TR>\n");
470 + }
471 + else
472 + {
473 + fprintf(out_fp,"\n" \
474 + "<TH ALIGN=center BGCOLOR=\"%s\">" \
475 + "<FONT SIZE=\"-2\">%s</FONT></TH>\n" \
476 + "<TH ALIGN=center BGCOLOR=\"%s\" COLSPAN=2>" \
477 + "<FONT SIZE=\"-2\">%s</FONT></TH>\n",
478 + LTBLUE, msg_h_avg, LTBLUE, msg_h_total);
479 + fprintf(out_fp,"<TH ALIGN=center BGCOLOR=\"%s\">" \
480 + "<FONT SIZE=\"-2\">%s</FONT></TH>\n" \
481 + "<TH ALIGN=center BGCOLOR=\"%s\" COLSPAN=2>" \
482 + "<FONT SIZE=\"-2\">%s</FONT></TH></TR>\n",
483 + GREEN, msg_h_avg, GREEN, msg_h_total);
484 + }
485
486 fprintf(out_fp,"<TR><TH HEIGHT=4></TH></TR>\n");
487 for (i=0;i<24;i++)
488 @@ -863,21 +901,29 @@
489 fprintf(out_fp,
490 "<TD ALIGN=right><FONT SIZE=\"-1\"><B>%.0f</B></FONT></TD>\n" \
491 "<TD ALIGN=right><FONT SIZE=\"-1\"><B>%.0f</B></FONT></TD>\n" \
492 - "<TD ALIGN=right><FONT SIZE=\"-2\">%3.02f%%</FONT></TD>\n",
493 + "<TD ALIGN=right><FONT SIZE=\"-2\">%3.02f%%</FONT></TD>",
494 (th_xfer[i]/days_in_month)/1024,th_xfer[i]/1024,
495 PCENT(th_xfer[i],t_xfer));
496 - fprintf(out_fp,
497 - "<TD ALIGN=right><FONT SIZE=\"-1\"><B>%.0f</B></FONT></TD>\n" \
498 - "<TD ALIGN=right><FONT SIZE=\"-1\"><B>%.0f</B></FONT></TD>\n" \
499 - "<TD ALIGN=right><FONT SIZE=\"-2\">%3.02f%%</FONT></TD>\n",
500 - (th_ixfer[i]/days_in_month)/1024,th_ixfer[i]/1024,
501 - PCENT(th_ixfer[i],t_ixfer));
502 - fprintf(out_fp,
503 - "<TD ALIGN=right><FONT SIZE=\"-1\"><B>%.0f</B></FONT></TD>\n" \
504 - "<TD ALIGN=right><FONT SIZE=\"-1\"><B>%.0f</B></FONT></TD>\n" \
505 - "<TD ALIGN=right><FONT SIZE=\"-2\">%3.02f%%</FONT></TD></TR>\n",
506 - (th_oxfer[i]/days_in_month)/1024,th_oxfer[i]/1024,
507 - PCENT(th_oxfer[i],t_oxfer));
508 + if (dump_inout == 0)
509 + {
510 + fprintf(out_fp,"</TR>\n");
511 + }
512 + else
513 + {
514 + fprintf(out_fp,"\n" \
515 + "<TD ALIGN=right><FONT SIZE=\"-1\"><B>%.0f</B></FONT></TD>\n" \
516 + "<TD ALIGN=right><FONT SIZE=\"-1\"><B>%.0f</B></FONT></TD>\n" \
517 + "<TD ALIGN=right><FONT SIZE=\"-2\">%3.02f%%</FONT></TD>\n",
518 + (th_ixfer[i]/days_in_month)/1024,th_ixfer[i]/1024,
519 + PCENT(th_ixfer[i],t_ixfer));
520 + fprintf(out_fp,
521 + "<TD ALIGN=right><FONT SIZE=\"-1\"><B>%.0f</B></FONT></TD>\n" \
522 + "<TD ALIGN=right><FONT SIZE=\"-1\"><B>%.0f</B></FONT></TD>\n" \
523 + "<TD ALIGN=right><FONT SIZE=\"-2\">%3.02f%%</FONT></TD></TR>\n",
524 + (th_oxfer[i]/days_in_month)/1024,th_oxfer[i]/1024,
525 + PCENT(th_oxfer[i],t_oxfer));
526 + }
527 +
528 avg_file += th_file[i]/days_in_month;
529 avg_xfer += (th_xfer[i]/days_in_month)/1024;
530 avg_ixfer+= (th_ixfer[i]/days_in_month)/1024;
531 @@ -919,13 +965,13 @@
532
533 fprintf(out_fp,"<TABLE WIDTH=510 BORDER=2 CELLSPACING=1 CELLPADDING=1>\n");
534 fprintf(out_fp,"<TR><TH HEIGHT=4></TH></TR>\n");
535 - if (flag) fprintf(out_fp,"<TR><TH BGCOLOR=\"%s\" ALIGN=CENTER COLSPAN=14>" \
536 + if (flag) fprintf(out_fp,"<TR><TH BGCOLOR=\"%s\" ALIGN=CENTER COLSPAN=%d>" \
537 "%s %llu %s %llu %s %s %s</TH></TR>\n",
538 - GREY, msg_top_top,tot_num,msg_top_of,
539 + GREY,(dump_inout==0)?10:14, msg_top_top,tot_num,msg_top_of,
540 t_site,msg_top_s,msg_h_by,msg_h_xfer);
541 - else fprintf(out_fp,"<TR><TH BGCOLOR=\"%s\" ALIGN=CENTER COLSPAN=14>" \
542 + else fprintf(out_fp,"<TR><TH BGCOLOR=\"%s\" ALIGN=CENTER COLSPAN=%d>" \
543 "%s %llu %s %llu %s</TH></TR>\n",
544 - GREY,msg_top_top, tot_num, msg_top_of, t_site, msg_top_s);
545 + GREY,(dump_inout==0)?10:14,msg_top_top, tot_num, msg_top_of, t_site, msg_top_s);
546 fprintf(out_fp,"<TR><TH HEIGHT=4></TH></TR>\n");
547 fprintf(out_fp,"<TR><TH BGCOLOR=\"%s\" ALIGN=center>" \
548 "<FONT SIZE=\"-1\">#</FONT></TH>\n",GREY);
549 @@ -935,10 +981,13 @@
550 "<FONT SIZE=\"-1\">%s</FONT></TH>\n",FILECOLOR,msg_h_files);
551 fprintf(out_fp,"<TH BGCOLOR=\"%s\" ALIGN=center COLSPAN=2>" \
552 "<FONT SIZE=\"-1\">%s</FONT></TH>\n",KBYTECOLOR,msg_h_xfer);
553 - fprintf(out_fp,"<TH BGCOLOR=\"%s\" ALIGN=center COLSPAN=2>" \
554 - "<FONT SIZE=\"-1\">%s</FONT></TH>\n",LTBLUE,msg_h_ixfer);
555 - fprintf(out_fp,"<TH BGCOLOR=\"%s\" ALIGN=center COLSPAN=2>" \
556 - "<FONT SIZE=\"-1\">%s</FONT></TH>\n",GREEN,msg_h_oxfer);
557 + if (dump_inout != 0)
558 + {
559 + fprintf(out_fp,"<TH BGCOLOR=\"%s\" ALIGN=center COLSPAN=2>" \
560 + "<FONT SIZE=\"-1\">%s</FONT></TH>\n",LTBLUE,msg_h_ixfer);
561 + fprintf(out_fp,"<TH BGCOLOR=\"%s\" ALIGN=center COLSPAN=2>" \
562 + "<FONT SIZE=\"-1\">%s</FONT></TH>\n",GREEN,msg_h_oxfer);
563 + }
564 fprintf(out_fp,"<TH BGCOLOR=\"%s\" ALIGN=center COLSPAN=2>" \
565 "<FONT SIZE=\"-1\">%s</FONT></TH>\n",VISITCOLOR,msg_h_visits);
566 fprintf(out_fp,"<TH BGCOLOR=\"%s\" ALIGN=center>" \
567 @@ -963,21 +1012,26 @@
568 "<TD ALIGN=right><FONT SIZE=\"-1\"><B>%llu</B></FONT></TD>\n" \
569 "<TD ALIGN=right><FONT SIZE=\"-2\">%3.02f%%</FONT></TD>\n" \
570 "<TD ALIGN=right><FONT SIZE=\"-1\"><B>%.0f</B></FONT></TD>\n" \
571 - "<TD ALIGN=right><FONT SIZE=\"-2\">%3.02f%%</FONT></TD>\n" \
572 - "<TD ALIGN=right><FONT SIZE=\"-1\"><B>%.0f</B></FONT></TD>\n" \
573 - "<TD ALIGN=right><FONT SIZE=\"-2\">%3.02f%%</FONT></TD>\n" \
574 - "<TD ALIGN=right><FONT SIZE=\"-1\"><B>%.0f</B></FONT></TD>\n" \
575 - "<TD ALIGN=right><FONT SIZE=\"-2\">%3.02f%%</FONT></TD>\n" \
576 - "<TD ALIGN=right><FONT SIZE=\"-1\"><B>%llu</B></FONT></TD>\n" \
577 - "<TD ALIGN=right><FONT SIZE=\"-2\">%3.02f%%</FONT></TD>\n" \
578 - "<TD ALIGN=left NOWRAP><FONT SIZE=\"-1\">",
579 + "<TD ALIGN=right><FONT SIZE=\"-2\">%3.02f%%</FONT></TD>\n",
580 i+1,hptr->count,
581 (t_hit==0)?0:((float)hptr->count/t_hit)*100.0,hptr->files,
582 (t_file==0)?0:((float)hptr->files/t_file)*100.0,hptr->xfer/1024,
583 - (t_xfer==0)?0:((float)hptr->xfer/t_xfer)*100.0,hptr->ixfer/1024,
584 - (t_ixfer==0)?0:((float)hptr->ixfer/t_ixfer)*100.0,hptr->oxfer/1024,
585 - (t_oxfer==0)?0:((float)hptr->oxfer/t_oxfer)*100.0,hptr->visit,
586 - (t_visit==0)?0:((float)hptr->visit/t_visit)*100.0);
587 + (t_xfer==0)?0:((float)hptr->xfer/t_xfer)*100.0);
588 + if (dump_inout != 0)
589 + {
590 + fprintf(out_fp,
591 + "<TD ALIGN=right><FONT SIZE=\"-1\"><B>%.0f</B></FONT></TD>\n" \
592 + "<TD ALIGN=right><FONT SIZE=\"-2\">%3.02f%%</FONT></TD>\n" \
593 + "<TD ALIGN=right><FONT SIZE=\"-1\"><B>%.0f</B></FONT></TD>\n" \
594 + "<TD ALIGN=right><FONT SIZE=\"-2\">%3.02f%%</FONT></TD>\n",
595 + hptr->ixfer/1024,(t_ixfer==0)?0:((float)hptr->ixfer/t_ixfer)*100.0,
596 + hptr->oxfer/1024,(t_oxfer==0)?0:((float)hptr->oxfer/t_oxfer)*100.0);
597 + }
598 + fprintf(out_fp,
599 + "<TD ALIGN=right><FONT SIZE=\"-1\"><B>%llu</B></FONT></TD>\n" \
600 + "<TD ALIGN=right><FONT SIZE=\"-2\">%3.02f%%</FONT></TD>\n" \
601 + "<TD ALIGN=left NOWRAP><FONT SIZE=\"-1\">",
602 + hptr->visit,(t_visit==0)?0:((float)hptr->visit/t_visit)*100.0);
603
604 if ((hptr->flag==OBJ_GRP)&&hlite_groups)
605 fprintf(out_fp,"<STRONG>%s</STRONG></FONT></TD></TR>\n",
606 @@ -997,7 +1051,7 @@
607 if (all_sites_page(h_reg, h_grp))
608 {
609 fprintf(out_fp,"<TR BGCOLOR=\"%s\">",GRPCOLOR);
610 - fprintf(out_fp,"<TD COLSPAN=14 ALIGN=\"center\">\n");
611 + fprintf(out_fp,"<TD COLSPAN=%d ALIGN=\"center\">\n",(dump_inout==0)?10:14);
612 fprintf(out_fp,"<FONT SIZE=\"-1\">");
613 fprintf(out_fp,"<A HREF=\"./site_%04d%02d.%s\">",
614 cur_year,cur_month,html_ext);
615 @@ -1034,13 +1088,19 @@
616
617 fprintf(out_fp,"<FONT SIZE=\"-1\"></CENTER><PRE>\n");
618
619 - fprintf(out_fp," %12s %12s %12s %12s %12s" \
620 - " %12s %s\n",
621 - msg_h_hits, msg_h_files, msg_h_xfer, msg_h_ixfer, msg_h_oxfer,
622 - msg_h_visits, msg_h_hname);
623 - fprintf(out_fp,"---------------- ---------------- ---------------- " \
624 - "---------------- ---------------- " \
625 - "---------------- --------------------\n\n");
626 + fprintf(out_fp," %12s %12s %12s",
627 + msg_h_hits, msg_h_files, msg_h_xfer);
628 + if (dump_inout != 0)
629 + {
630 + fprintf(out_fp," %12s %12s", msg_h_ixfer, msg_h_oxfer);
631 + }
632 + fprintf(out_fp," %12s %s\n", msg_h_visits, msg_h_hname);
633 + fprintf(out_fp,"---------------- ---------------- ---------------- ");
634 + if (dump_inout != 0)
635 + {
636 + fprintf(out_fp,"---------------- ---------------- ");
637 + }
638 + fprintf(out_fp,"---------------- --------------------\n\n");
639
640 /* Do groups first (if any) */
641 pointer=h_array;
642 @@ -1050,15 +1110,21 @@
643 if (hptr->flag == OBJ_GRP)
644 {
645 fprintf(out_fp,
646 - "%-8llu %6.02f%% %8llu %6.02f%% %8.0f %6.02f%% " \
647 - "%8.0f %6.02f%% %8.0f %6.02f%% %8llu %6.02f%% %s\n",
648 + "%-8llu %6.02f%% %8llu %6.02f%% %8.0f %6.02f%% ",
649 hptr->count,
650 (t_hit==0)?0:((float)hptr->count/t_hit)*100.0,hptr->files,
651 (t_file==0)?0:((float)hptr->files/t_file)*100.0,hptr->xfer/1024,
652 - (t_xfer==0)?0:((float)hptr->xfer/t_xfer)*100.0,hptr->ixfer/1024,
653 - (t_ixfer==0)?0:((float)hptr->ixfer/t_ixfer)*100.0,hptr->oxfer/1024,
654 - (t_oxfer==0)?0:((float)hptr->oxfer/t_oxfer)*100.0,hptr->visit,
655 - (t_visit==0)?0:((float)hptr->visit/t_visit)*100.0,
656 + (t_xfer==0)?0:((float)hptr->xfer/t_xfer)*100.0);
657 + if (dump_inout != 0)
658 + {
659 + fprintf(out_fp,
660 + "%8.0f %6.02f%% %8.0f %6.02f%% ",
661 + hptr->ixfer/1024,(t_ixfer==0)?0:((float)hptr->ixfer/t_ixfer)*100.0,
662 + hptr->oxfer/1024,(t_oxfer==0)?0:((float)hptr->oxfer/t_oxfer)*100.0);
663 + }
664 + fprintf(out_fp,
665 + "%8llu %6.02f%% %s\n",
666 + hptr->visit,(t_visit==0)?0:((float)hptr->visit/t_visit)*100.0,
667 hptr->string);
668 h_grp--;
669 }
670 @@ -1074,15 +1140,21 @@
671 if (hptr->flag == OBJ_REG)
672 {
673 fprintf(out_fp,
674 - "%-8llu %6.02f%% %8llu %6.02f%% %8.0f %6.02f%% " \
675 - "%8.0f %6.02f%% %8.0f %6.02f%% %8llu %6.02f%% %s\n",
676 + "%-8llu %6.02f%% %8llu %6.02f%% %8.0f %6.02f%% ",
677 hptr->count,
678 (t_hit==0)?0:((float)hptr->count/t_hit)*100.0,hptr->files,
679 (t_file==0)?0:((float)hptr->files/t_file)*100.0,hptr->xfer/1024,
680 - (t_xfer==0)?0:((float)hptr->xfer/t_xfer)*100.0,hptr->ixfer/1024,
681 - (t_ixfer==0)?0:((float)hptr->ixfer/t_ixfer)*100.0,hptr->oxfer/1024,
682 - (t_oxfer==0)?0:((float)hptr->oxfer/t_oxfer)*100.0,hptr->visit,
683 - (t_visit==0)?0:((float)hptr->visit/t_visit)*100.0,
684 + (t_xfer==0)?0:((float)hptr->xfer/t_xfer)*100.0);
685 + if (dump_inout != 0)
686 + {
687 + fprintf(out_fp,
688 + "%8.0f %6.02f%% %8.0f %6.02f%% ",
689 + hptr->ixfer/1024,(t_ixfer==0)?0:((float)hptr->ixfer/t_ixfer)*100.0,
690 + hptr->oxfer/1024,(t_oxfer==0)?0:((float)hptr->oxfer/t_oxfer)*100.0);
691 + }
692 + fprintf(out_fp,
693 + "%8llu %6.02f%% %s\n",
694 + hptr->visit,(t_visit==0)?0:((float)hptr->visit/t_visit)*100.0,
695 hptr->string);
696 h_reg--;
697 }
698 @@ -1125,13 +1197,13 @@
699
700 fprintf(out_fp,"<TABLE WIDTH=510 BORDER=2 CELLSPACING=1 CELLPADDING=1>\n");
701 fprintf(out_fp,"<TR><TH HEIGHT=4></TH></TR>\n");
702 - if (flag) fprintf(out_fp,"<TR><TH BGCOLOR=\"%s\" ALIGN=CENTER COLSPAN=10>" \
703 + if (flag) fprintf(out_fp,"<TR><TH BGCOLOR=\"%s\" ALIGN=CENTER COLSPAN=%d>" \
704 "%s %llu %s %llu %s %s %s</TH></TR>\n",
705 - GREY,msg_top_top,tot_num,msg_top_of,
706 + GREY,(dump_inout==0)?6:10,msg_top_top,tot_num,msg_top_of,
707 t_url,msg_top_u,msg_h_by,msg_h_xfer);
708 - else fprintf(out_fp,"<TR><TH BGCOLOR=\"%s\" ALIGN=CENTER COLSPAN=10>" \
709 + else fprintf(out_fp,"<TR><TH BGCOLOR=\"%s\" ALIGN=CENTER COLSPAN=%d>" \
710 "%s %llu %s %llu %s</TH></TR>\n",
711 - GREY,msg_top_top,tot_num,msg_top_of,t_url,msg_top_u);
712 + GREY,(dump_inout==0)?6:10,msg_top_top,tot_num,msg_top_of,t_url,msg_top_u);
713 fprintf(out_fp,"<TR><TH HEIGHT=4></TH></TR>\n");
714 fprintf(out_fp,"<TR><TH BGCOLOR=\"%s\" ALIGN=center>" \
715 "<FONT SIZE=\"-1\">#</FONT></TH>\n",GREY);
716 @@ -1141,12 +1213,15 @@
717 fprintf(out_fp,"<TH BGCOLOR=\"%s\" ALIGN=center COLSPAN=2>" \
718 "<FONT SIZE=\"-1\">%s</FONT></TH>\n",
719 KBYTECOLOR,msg_h_xfer);
720 - fprintf(out_fp,"<TH BGCOLOR=\"%s\" ALIGN=center COLSPAN=2>" \
721 - "<FONT SIZE=\"-1\">%s</FONT></TH>\n",
722 - LTBLUE,msg_h_ixfer);
723 - fprintf(out_fp,"<TH BGCOLOR=\"%s\" ALIGN=center COLSPAN=2>" \
724 - "<FONT SIZE=\"-1\">%s</FONT></TH>\n",
725 - GREEN,msg_h_oxfer);
726 + if (dump_inout!=0)
727 + {
728 + fprintf(out_fp,"<TH BGCOLOR=\"%s\" ALIGN=center COLSPAN=2>" \
729 + "<FONT SIZE=\"-1\">%s</FONT></TH>\n",
730 + LTBLUE,msg_h_ixfer);
731 + fprintf(out_fp,"<TH BGCOLOR=\"%s\" ALIGN=center COLSPAN=2>" \
732 + "<FONT SIZE=\"-1\">%s</FONT></TH>\n",
733 + GREEN,msg_h_oxfer);
734 + }
735 fprintf(out_fp,"<TH BGCOLOR=\"%s\" ALIGN=center>" \
736 "<FONT SIZE=\"-1\">%s</FONT></TH></TR>\n",
737 MISCCOLOR,msg_h_url);
738 @@ -1168,20 +1243,28 @@
739 "<TD ALIGN=right><FONT SIZE=\"-1\"><B>%llu</B></FONT></TD>\n"\
740 "<TD ALIGN=right><FONT SIZE=\"-2\">%3.02f%%</FONT></TD>\n" \
741 "<TD ALIGN=right><FONT SIZE=\"-1\"><B>%.0f</B></FONT></TD>\n"\
742 - "<TD ALIGN=right><FONT SIZE=\"-2\">%3.02f%%</FONT></TD>\n" \
743 - "<TD ALIGN=right><FONT SIZE=\"-1\"><B>%.0f</B></FONT></TD>\n"\
744 - "<TD ALIGN=right><FONT SIZE=\"-2\">%3.02f%%</FONT></TD>\n" \
745 - "<TD ALIGN=right><FONT SIZE=\"-1\"><B>%.0f</B></FONT></TD>\n"\
746 - "<TD ALIGN=right><FONT SIZE=\"-2\">%3.02f%%</FONT></TD>\n" \
747 - "<TD ALIGN=left NOWRAP><FONT SIZE=\"-1\">",
748 + "<TD ALIGN=right><FONT SIZE=\"-2\">%3.02f%%</FONT></TD>\n",
749 i+1,uptr->count,
750 (t_hit==0)?0:((float)uptr->count/t_hit)*100.0,
751 uptr->xfer/1024,
752 - (t_xfer==0)?0:((float)uptr->xfer/t_xfer)*100.0,
753 - uptr->ixfer/1024,
754 - (t_ixfer==0)?0:((float)uptr->ixfer/t_ixfer)*100.0,
755 - uptr->oxfer/1024,
756 - (t_oxfer==0)?0:((float)uptr->oxfer/t_oxfer)*100.0);
757 + (t_xfer==0)?0:((float)uptr->xfer/t_xfer)*100.0);
758 + if (dump_inout==0)
759 + {
760 + fprintf(out_fp, "<TD ALIGN=left NOWRAP><FONT SIZE=\"-1\">");
761 + }
762 + else
763 + {
764 + fprintf(out_fp,
765 + "<TD ALIGN=right><FONT SIZE=\"-1\"><B>%.0f</B></FONT></TD>\n"\
766 + "<TD ALIGN=right><FONT SIZE=\"-2\">%3.02f%%</FONT></TD>\n" \
767 + "<TD ALIGN=right><FONT SIZE=\"-1\"><B>%.0f</B></FONT></TD>\n"\
768 + "<TD ALIGN=right><FONT SIZE=\"-2\">%3.02f%%</FONT></TD>\n" \
769 + "<TD ALIGN=left NOWRAP><FONT SIZE=\"-1\">",
770 + uptr->ixfer/1024,
771 + (t_ixfer==0)?0:((float)uptr->ixfer/t_ixfer)*100.0,
772 + uptr->oxfer/1024,
773 + (t_oxfer==0)?0:((float)uptr->oxfer/t_oxfer)*100.0);
774 + }
775
776 if (uptr->flag==OBJ_GRP)
777 {
778 @@ -1227,7 +1310,7 @@
779 if (all_urls_page(u_reg, u_grp))
780 {
781 fprintf(out_fp,"<TR BGCOLOR=\"%s\">",GRPCOLOR);
782 - fprintf(out_fp,"<TD COLSPAN=10 ALIGN=\"center\">\n");
783 + fprintf(out_fp,"<TD COLSPAN=%d ALIGN=\"center\">\n",(dump_inout==0)?6:10);
784 fprintf(out_fp,"<FONT SIZE=\"-1\">");
785 fprintf(out_fp,"<A HREF=\"./url_%04d%02d.%s\">",
786 cur_year,cur_month,html_ext);
787 @@ -1264,10 +1347,18 @@
788
789 fprintf(out_fp,"<FONT SIZE=\"-1\"></CENTER><PRE>\n");
790
791 - fprintf(out_fp," %12s %12s %12s %12s %s\n",
792 - msg_h_hits,msg_h_xfer,msg_h_ixfer,msg_h_oxfer,msg_h_url);
793 - fprintf(out_fp,"---------------- ---------------- ---------------- " \
794 - "---------------- --------------------\n\n");
795 + fprintf(out_fp," %12s %12s", msg_h_hits,msg_h_xfer);
796 + if (dump_inout != 0)
797 + {
798 + fprintf(out_fp," %12s %12s", msg_h_ixfer, msg_h_oxfer);
799 + }
800 + fprintf(out_fp," %s\n", msg_h_url);
801 + fprintf(out_fp,"---------------- ---------------- ");
802 + if (dump_inout != 0)
803 + {
804 + fprintf(out_fp,"---------------- ---------------- ");
805 + }
806 + fprintf(out_fp,"--------------------\n\n");
807
808 /* do groups first (if any) */
809 pointer=u_array;
810 @@ -1276,16 +1367,20 @@
811 uptr=*pointer++;
812 if (uptr->flag == OBJ_GRP)
813 {
814 - fprintf(out_fp,"%-8llu %6.02f%% %8.0f %6.02f%% %8.0f %6.02f%% " \
815 - "%8.0f %6.02f%% %s\n",
816 + fprintf(out_fp,"%-8llu %6.02f%% %8.0f %6.02f%%",
817 uptr->count,
818 (t_hit==0)?0:((float)uptr->count/t_hit)*100.0,
819 uptr->xfer/1024,
820 - (t_xfer==0)?0:((float)uptr->xfer/t_xfer)*100.0,
821 - uptr->ixfer/1024,
822 - (t_ixfer==0)?0:((float)uptr->ixfer/t_ixfer)*100.0,
823 - uptr->oxfer/1024,
824 - (t_oxfer==0)?0:((float)uptr->oxfer/t_oxfer)*100.0,
825 + (t_xfer==0)?0:((float)uptr->xfer/t_xfer)*100.0);
826 + if (dump_inout != 0)
827 + {
828 + fprintf(out_fp," %8.0f %6.02f%% %8.0f %6.02f%%",
829 + uptr->ixfer/1024,
830 + (t_ixfer==0)?0:((float)uptr->ixfer/t_ixfer)*100.0,
831 + uptr->oxfer/1024,
832 + (t_oxfer==0)?0:((float)uptr->oxfer/t_oxfer)*100.0);
833 + }
834 + fprintf(out_fp," %s\n",
835 uptr->string);
836 u_grp--;
837 }
838 @@ -1300,16 +1395,20 @@
839 uptr=*pointer++;
840 if (uptr->flag == OBJ_REG)
841 {
842 - fprintf(out_fp,"%-8llu %6.02f%% %8.0f %6.02f%% %8.0f %6.02f%% " \
843 - "%8.0f %6.02f%% %s\n",
844 + fprintf(out_fp,"%-8llu %6.02f%% %8.0f %6.02f%%",
845 uptr->count,
846 (t_hit==0)?0:((float)uptr->count/t_hit)*100.0,
847 uptr->xfer/1024,
848 - (t_xfer==0)?0:((float)uptr->xfer/t_xfer)*100.0,
849 - uptr->ixfer/1024,
850 - (t_ixfer==0)?0:((float)uptr->ixfer/t_ixfer)*100.0,
851 - uptr->oxfer/1024,
852 - (t_oxfer==0)?0:((float)uptr->oxfer/t_oxfer)*100.0,
853 + (t_xfer==0)?0:((float)uptr->xfer/t_xfer)*100.0);
854 + if (dump_inout != 0)
855 + {
856 + fprintf(out_fp," %8.0f %6.02f%% %8.0f %6.02f%%",
857 + uptr->ixfer/1024,
858 + (t_ixfer==0)?0:((float)uptr->ixfer/t_ixfer)*100.0,
859 + uptr->oxfer/1024,
860 + (t_oxfer==0)?0:((float)uptr->oxfer/t_oxfer)*100.0);
861 + }
862 + fprintf(out_fp," %s\n",
863 uptr->string);
864 u_reg--;
865 }
866 @@ -1887,9 +1986,9 @@
867
868 fprintf(out_fp,"<TABLE WIDTH=510 BORDER=2 CELLSPACING=1 CELLPADDING=1>\n");
869 fprintf(out_fp,"<TR><TH HEIGHT=4></TH></TR>\n");
870 - fprintf(out_fp,"<TR><TH BGCOLOR=\"%s\" ALIGN=CENTER COLSPAN=14>" \
871 + fprintf(out_fp,"<TR><TH BGCOLOR=\"%s\" ALIGN=CENTER COLSPAN=%d>" \
872 "%s %llu %s %llu %s</TH></TR>\n",
873 - GREY,msg_top_top, tot_num, msg_top_of, t_user, msg_top_i);
874 + GREY,(dump_inout==0)?10:14,msg_top_top, tot_num, msg_top_of, t_user, msg_top_i);
875 fprintf(out_fp,"<TR><TH HEIGHT=4></TH></TR>\n");
876 fprintf(out_fp,"<TR><TH BGCOLOR=\"%s\" ALIGN=center>" \
877 "<FONT SIZE=\"-1\">#</FONT></TH>\n",GREY);
878 @@ -1899,10 +1998,13 @@
879 "<FONT SIZE=\"-1\">%s</FONT></TH>\n",FILECOLOR,msg_h_files);
880 fprintf(out_fp,"<TH BGCOLOR=\"%s\" ALIGN=center COLSPAN=2>" \
881 "<FONT SIZE=\"-1\">%s</FONT></TH>\n",KBYTECOLOR,msg_h_xfer);
882 - fprintf(out_fp,"<TH BGCOLOR=\"%s\" ALIGN=center COLSPAN=2>" \
883 - "<FONT SIZE=\"-1\">%s</FONT></TH>\n",LTBLUE,msg_h_ixfer);
884 - fprintf(out_fp,"<TH BGCOLOR=\"%s\" ALIGN=center COLSPAN=2>" \
885 - "<FONT SIZE=\"-1\">%s</FONT></TH>\n",GREEN,msg_h_oxfer);
886 + if (dump_inout != 0)
887 + {
888 + fprintf(out_fp,"<TH BGCOLOR=\"%s\" ALIGN=center COLSPAN=2>" \
889 + "<FONT SIZE=\"-1\">%s</FONT></TH>\n",LTBLUE,msg_h_ixfer);
890 + fprintf(out_fp,"<TH BGCOLOR=\"%s\" ALIGN=center COLSPAN=2>" \
891 + "<FONT SIZE=\"-1\">%s</FONT></TH>\n",GREEN,msg_h_oxfer);
892 + }
893 fprintf(out_fp,"<TH BGCOLOR=\"%s\" ALIGN=center COLSPAN=2>" \
894 "<FONT SIZE=\"-1\">%s</FONT></TH>\n",VISITCOLOR,msg_h_visits);
895 fprintf(out_fp,"<TH BGCOLOR=\"%s\" ALIGN=center>" \
896 @@ -1927,20 +2029,26 @@
897 "<TD ALIGN=right><FONT SIZE=\"-1\"><B>%llu</B></FONT></TD>\n" \
898 "<TD ALIGN=right><FONT SIZE=\"-2\">%3.02f%%</FONT></TD>\n" \
899 "<TD ALIGN=right><FONT SIZE=\"-1\"><B>%.0f</B></FONT></TD>\n" \
900 - "<TD ALIGN=right><FONT SIZE=\"-2\">%3.02f%%</FONT></TD>\n" \
901 - "<TD ALIGN=right><FONT SIZE=\"-1\"><B>%.0f</B></FONT></TD>\n" \
902 - "<TD ALIGN=right><FONT SIZE=\"-2\">%3.02f%%</FONT></TD>\n" \
903 - "<TD ALIGN=right><FONT SIZE=\"-1\"><B>%.0f</B></FONT></TD>\n" \
904 - "<TD ALIGN=right><FONT SIZE=\"-2\">%3.02f%%</FONT></TD>\n" \
905 - "<TD ALIGN=right><FONT SIZE=\"-1\"><B>%llu</B></FONT></TD>\n" \
906 - "<TD ALIGN=right><FONT SIZE=\"-2\">%3.02f%%</FONT></TD>\n" \
907 - "<TD ALIGN=left NOWRAP><FONT SIZE=\"-1\">",
908 + "<TD ALIGN=right><FONT SIZE=\"-2\">%3.02f%%</FONT></TD>\n",
909 i+1,iptr->count,
910 (t_hit==0)?0:((float)iptr->count/t_hit)*100.0,iptr->files,
911 (t_file==0)?0:((float)iptr->files/t_file)*100.0,iptr->xfer/1024,
912 - (t_xfer==0)?0:((float)iptr->xfer/t_xfer)*100.0,iptr->ixfer/1024,
913 - (t_ixfer==0)?0:((float)iptr->ixfer/t_ixfer)*100.0,iptr->oxfer/1024,
914 - (t_oxfer==0)?0:((float)iptr->oxfer/t_oxfer)*100.0,iptr->visit,
915 + (t_xfer==0)?0:((float)iptr->xfer/t_xfer)*100.0);
916 + if (dump_inout != 0)
917 + {
918 + fprintf(out_fp,
919 + "<TD ALIGN=right><FONT SIZE=\"-1\"><B>%.0f</B></FONT></TD>\n" \
920 + "<TD ALIGN=right><FONT SIZE=\"-2\">%3.02f%%</FONT></TD>\n" \
921 + "<TD ALIGN=right><FONT SIZE=\"-1\"><B>%.0f</B></FONT></TD>\n" \
922 + "<TD ALIGN=right><FONT SIZE=\"-2\">%3.02f%%</FONT></TD>\n",
923 + iptr->ixfer/1024,(t_ixfer==0)?0:((float)iptr->ixfer/t_ixfer)*100.0,
924 + iptr->oxfer/1024,(t_oxfer==0)?0:((float)iptr->oxfer/t_oxfer)*100.0);
925 + }
926 + fprintf(out_fp,
927 + "<TD ALIGN=right><FONT SIZE=\"-1\"><B>%llu</B></FONT></TD>\n" \
928 + "<TD ALIGN=right><FONT SIZE=\"-2\">%3.02f%%</FONT></TD>\n" \
929 + "<TD ALIGN=left NOWRAP><FONT SIZE=\"-1\">",
930 + iptr->visit,
931 (t_visit==0)?0:((float)iptr->visit/t_visit)*100.0);
932
933 if ((iptr->flag==OBJ_GRP)&&hlite_groups)
934 @@ -1959,7 +2067,7 @@
935 if (all_users_page(i_reg, i_grp))
936 {
937 fprintf(out_fp,"<TR BGCOLOR=\"%s\">",GRPCOLOR);
938 - fprintf(out_fp,"<TD COLSPAN=14 ALIGN=\"center\">\n");
939 + fprintf(out_fp,"<TD COLSPAN=%d ALIGN=\"center\">\n",(dump_inout==0)?10:14);
940 fprintf(out_fp,"<FONT SIZE=\"-1\">");
941 fprintf(out_fp,"<A HREF=\"./user_%04d%02d.%s\">",
942 cur_year,cur_month,html_ext);
943 @@ -1993,13 +2101,19 @@
944
945 fprintf(out_fp,"<FONT SIZE=\"-1\"></CENTER><PRE>\n");
946
947 - fprintf(out_fp," %12s %12s %12s %12s %12s %12s"\
948 - " %s\n",
949 - msg_h_hits, msg_h_files, msg_h_xfer, msg_h_ixfer, msg_h_oxfer,
950 - msg_h_visits, msg_h_uname);
951 - fprintf(out_fp,"---------------- ---------------- ---------------- " \
952 - "---------------- ---------------- " \
953 - "---------------- --------------------\n\n");
954 + fprintf(out_fp," %12s %12s %12s",
955 + msg_h_hits, msg_h_files, msg_h_xfer);
956 + if (dump_inout != 0)
957 + {
958 + fprintf(out_fp," %12s %12s", msg_h_ixfer, msg_h_oxfer);
959 + }
960 + fprintf(out_fp," %12s %s\n", msg_h_visits, msg_h_uname);
961 + fprintf(out_fp,"---------------- ---------------- ---------------- ");
962 + if (dump_inout != 0)
963 + {
964 + fprintf(out_fp,"---------------- ---------------- ");
965 + }
966 + fprintf(out_fp,"---------------- --------------------\n\n");
967
968 /* Do groups first (if any) */
969 pointer=i_array;
970 @@ -2009,15 +2123,21 @@
971 if (iptr->flag == OBJ_GRP)
972 {
973 fprintf(out_fp,
974 - "%-8llu %6.02f%% %8llu %6.02f%% %8.0f %6.02f%% %8.0f %6.02f%% "\
975 - "%8.0f %6.02f%% %8llu %6.02f%% %s\n",
976 + "%-8llu %6.02f%% %8llu %6.02f%% %8.0f %6.02f%% ",
977 iptr->count,
978 (t_hit==0)?0:((float)iptr->count/t_hit)*100.0,iptr->files,
979 (t_file==0)?0:((float)iptr->files/t_file)*100.0,iptr->xfer/1024,
980 - (t_xfer==0)?0:((float)iptr->xfer/t_xfer)*100.0,iptr->ixfer/1024,
981 - (t_ixfer==0)?0:((float)iptr->ixfer/t_ixfer)*100.0,iptr->oxfer/1024,
982 - (t_oxfer==0)?0:((float)iptr->oxfer/t_oxfer)*100.0,iptr->visit,
983 - (t_visit==0)?0:((float)iptr->visit/t_visit)*100.0,
984 + (t_xfer==0)?0:((float)iptr->xfer/t_xfer)*100.0);
985 + if (dump_inout != 0)
986 + {
987 + fprintf(out_fp,
988 + "%8.0f %6.02f%% %8.0f %6.02f%% ",
989 + iptr->ixfer/1024,(t_ixfer==0)?0:((float)iptr->ixfer/t_ixfer)*100.0,
990 + iptr->oxfer/1024,(t_oxfer==0)?0:((float)iptr->oxfer/t_oxfer)*100.0);
991 + }
992 + fprintf(out_fp,
993 + "%8llu %6.02f%% %s\n",
994 + iptr->visit,(t_visit==0)?0:((float)iptr->visit/t_visit)*100.0,
995 iptr->string);
996 i_grp--;
997 }
998 @@ -2033,15 +2153,21 @@
999 if (iptr->flag == OBJ_REG)
1000 {
1001 fprintf(out_fp,
1002 - "%-8llu %6.02f%% %8llu %6.02f%% %8.0f %6.02f%% %8.0f %6.02f%% "\
1003 - "%8.0f %6.02f%% %8llu %6.02f%% %s\n",
1004 + "%-8llu %6.02f%% %8llu %6.02f%% %8.0f %6.02f%% ",
1005 iptr->count,
1006 (t_hit==0)?0:((float)iptr->count/t_hit)*100.0,iptr->files,
1007 (t_file==0)?0:((float)iptr->files/t_file)*100.0,iptr->xfer/1024,
1008 - (t_xfer==0)?0:((float)iptr->xfer/t_xfer)*100.0,iptr->ixfer/1024,
1009 - (t_ixfer==0)?0:((float)iptr->ixfer/t_ixfer)*100.0,iptr->oxfer/1024,
1010 - (t_oxfer==0)?0:((float)iptr->oxfer/t_oxfer)*100.0,iptr->visit,
1011 - (t_visit==0)?0:((float)iptr->visit/t_visit)*100.0,
1012 + (t_xfer==0)?0:((float)iptr->xfer/t_xfer)*100.0);
1013 + if (dump_inout != 0)
1014 + {
1015 + fprintf(out_fp,
1016 + "%8.0f %6.02f%% %8.0f %6.02f%% ",
1017 + iptr->ixfer/1024,(t_ixfer==0)?0:((float)iptr->ixfer/t_ixfer)*100.0,
1018 + iptr->oxfer/1024,(t_oxfer==0)?0:((float)iptr->oxfer/t_oxfer)*100.0);
1019 + }
1020 + fprintf(out_fp,
1021 + "%8llu %6.02f%% %s\n",
1022 + iptr->visit,(t_visit==0)?0:((float)iptr->visit/t_visit)*100.0,
1023 iptr->string);
1024 i_reg--;
1025 }
1026 @@ -2211,9 +2337,9 @@
1027 for (i=0;i<ntop_ctrys;i++) if (top_ctrys[i]->count!=0) tot_num++;
1028 fprintf(out_fp,"<TABLE WIDTH=510 BORDER=2 CELLSPACING=1 CELLPADDING=1>\n");
1029 fprintf(out_fp,"<TR><TH HEIGHT=4></TH></TR>\n");
1030 - fprintf(out_fp,"<TR><TH BGCOLOR=\"%s\" ALIGN=CENTER COLSPAN=12>" \
1031 + fprintf(out_fp,"<TR><TH BGCOLOR=\"%s\" ALIGN=CENTER COLSPAN=%d>" \
1032 "%s %d %s %d %s</TH></TR>\n",
1033 - GREY,msg_top_top,tot_num,msg_top_of,tot_ctry,msg_top_c);
1034 + GREY,(dump_inout==0)?8:12,msg_top_top,tot_num,msg_top_of,tot_ctry,msg_top_c);
1035 fprintf(out_fp,"<TR><TH HEIGHT=4></TH></TR>\n");
1036 fprintf(out_fp,"<TR><TH BGCOLOR=\"%s\" ALIGN=center>" \
1037 "<FONT SIZE=\"-1\">#</FONT></TH>\n",GREY);
1038 @@ -2223,10 +2349,13 @@
1039 "<FONT SIZE=\"-1\">%s</FONT></TH>\n",FILECOLOR,msg_h_files);
1040 fprintf(out_fp,"<TH BGCOLOR=\"%s\" ALIGN=center COLSPAN=2>" \
1041 "<FONT SIZE=\"-1\">%s</FONT></TH>\n",KBYTECOLOR,msg_h_xfer);
1042 - fprintf(out_fp,"<TH BGCOLOR=\"%s\" ALIGN=center COLSPAN=2>" \
1043 - "<FONT SIZE=\"-1\">%s</FONT></TH>\n",LTBLUE,msg_h_ixfer);
1044 - fprintf(out_fp,"<TH BGCOLOR=\"%s\" ALIGN=center COLSPAN=2>" \
1045 - "<FONT SIZE=\"-1\">%s</FONT></TH>\n",GREEN,msg_h_oxfer);
1046 + if (dump_inout != 0)
1047 + {
1048 + fprintf(out_fp,"<TH BGCOLOR=\"%s\" ALIGN=center COLSPAN=2>" \
1049 + "<FONT SIZE=\"-1\">%s</FONT></TH>\n",LTBLUE,msg_h_ixfer);
1050 + fprintf(out_fp,"<TH BGCOLOR=\"%s\" ALIGN=center COLSPAN=2>" \
1051 + "<FONT SIZE=\"-1\">%s</FONT></TH>\n",GREEN,msg_h_oxfer);
1052 + }
1053 fprintf(out_fp,"<TH BGCOLOR=\"%s\" ALIGN=center>" \
1054 "<FONT SIZE=\"-1\">%s</FONT></TH></TR>\n",MISCCOLOR,msg_h_ctry);
1055 fprintf(out_fp,"<TR><TH HEIGHT=4></TH></TR>\n");
1056 @@ -2246,31 +2375,39 @@
1057 }
1058
1059 if (top_ctrys[i]->count!=0)
1060 - fprintf(out_fp,"<TR>" \
1061 + {
1062 + fprintf(out_fp,"<TR>" \
1063 "<TD ALIGN=center><FONT SIZE=\"-1\"><B>%d</B></FONT></TD>\n" \
1064 "<TD ALIGN=right><FONT SIZE=\"-1\"><B>%llu</B></FONT></TD>\n"\
1065 "<TD ALIGN=right><FONT SIZE=\"-2\">%3.02f%%</FONT></TD>\n" \
1066 "<TD ALIGN=right><FONT SIZE=\"-1\"><B>%llu</B></FONT></TD>\n"\
1067 "<TD ALIGN=right><FONT SIZE=\"-2\">%3.02f%%</FONT></TD>\n" \
1068 "<TD ALIGN=right><FONT SIZE=\"-1\"><B>%.0f</B></FONT></TD>\n"\
1069 - "<TD ALIGN=right><FONT SIZE=\"-2\">%3.02f%%</FONT></TD>\n" \
1070 - "<TD ALIGN=right><FONT SIZE=\"-1\"><B>%.0f</B></FONT></TD>\n" \
1071 - "<TD ALIGN=right><FONT SIZE=\"-2\">%3.02f%%</FONT></TD>\n" \
1072 - "<TD ALIGN=right><FONT SIZE=\"-1\"><B>%.0f</B></FONT></TD>\n" \
1073 - "<TD ALIGN=right><FONT SIZE=\"-2\">%3.02f%%</FONT></TD>\n" \
1074 - "<TD ALIGN=left NOWRAP>%s<FONT SIZE=\"-1\">%s</FONT>" \
1075 - "</TD></TR>\n",
1076 + "<TD ALIGN=right><FONT SIZE=\"-2\">%3.02f%%</FONT></TD>\n",
1077 i+1,top_ctrys[i]->count,
1078 (t_hit==0)?0:((float)top_ctrys[i]->count/t_hit)*100.0,
1079 top_ctrys[i]->files,
1080 (t_file==0)?0:((float)top_ctrys[i]->files/t_file)*100.0,
1081 top_ctrys[i]->xfer/1024,
1082 - (t_xfer==0)?0:((float)top_ctrys[i]->xfer/t_xfer)*100.0,
1083 + (t_xfer==0)?0:((float)top_ctrys[i]->xfer/t_xfer)*100.0);
1084 + if (dump_inout != 0)
1085 + {
1086 + fprintf(out_fp,
1087 + "<TD ALIGN=right><FONT SIZE=\"-1\"><B>%.0f</B></FONT></TD>\n" \
1088 + "<TD ALIGN=right><FONT SIZE=\"-2\">%3.02f%%</FONT></TD>\n" \
1089 + "<TD ALIGN=right><FONT SIZE=\"-1\"><B>%.0f</B></FONT></TD>\n" \
1090 + "<TD ALIGN=right><FONT SIZE=\"-2\">%3.02f%%</FONT></TD>\n",
1091 top_ctrys[i]->ixfer/1024,
1092 (t_ixfer==0)?0:((float)top_ctrys[i]->ixfer/t_ixfer)*100.0,
1093 top_ctrys[i]->oxfer/1024,
1094 - (t_oxfer==0)?0:((float)top_ctrys[i]->oxfer/t_oxfer)*100.0,
1095 + (t_oxfer==0)?0:((float)top_ctrys[i]->oxfer/t_oxfer)*100.0);
1096 + }
1097 +
1098 + fprintf(out_fp,
1099 + "<TD ALIGN=left NOWRAP>%s<FONT SIZE=\"-1\">%s</FONT>" \
1100 + "</TD></TR>\n",
1101 flag_buf,top_ctrys[i]->desc);
1102 + }
1103 }
1104 fprintf(out_fp,"<TR><TH HEIGHT=4></TH></TR>\n");
1105 fprintf(out_fp,"</TABLE>\n<P>\n");
1106 @@ -2297,9 +2434,12 @@
1107 /* need a header? */
1108 if (dump_header)
1109 {
1110 - fprintf(out_fp,"%s\t%s\t%s\t%s\t%s\t%s\t%s\n",
1111 - msg_h_hits,msg_h_files,msg_h_xfer,msg_h_ixfer,msg_h_oxfer,msg_h_visits,
1112 - msg_h_hname);
1113 + fprintf(out_fp,"%s\t%s\t%s", msg_h_hits,msg_h_files,msg_h_xfer);
1114 + if (dump_inout != 0)
1115 + {
1116 + fprintf(out_fp,"\t%s\t%s", msg_h_ixfer,msg_h_oxfer);
1117 + }
1118 + fprintf(out_fp,"\t%s\t%s\n", msg_h_visits,msg_h_hname);
1119 }
1120
1121 /* dump 'em */
1122 @@ -2309,10 +2449,14 @@
1123 hptr=*pointer++;
1124 if (hptr->flag != OBJ_GRP)
1125 {
1126 - fprintf(out_fp,
1127 - "%llu\t%llu\t%.0f\t%.0f\t%.0f\t%llu\t%s\n",
1128 - hptr->count,hptr->files,hptr->xfer/1024,
1129 - hptr->ixfer/1024,hptr->oxfer/1024,
1130 + fprintf(out_fp,"%llu\t%llu\t%.0f",
1131 + hptr->count,hptr->files,hptr->xfer/1024);
1132 + if (dump_inout != 0)
1133 + {
1134 + fprintf(out_fp, "\t%.0f\t%.0f",
1135 + hptr->ixfer/1024,hptr->oxfer/1024);
1136 + }
1137 + fprintf(out_fp, "\t%llu\t%s\n",
1138 hptr->visit,hptr->string);
1139 }
1140 cnt--;
1141 @@ -2342,8 +2486,12 @@
1142 /* need a header? */
1143 if (dump_header)
1144 {
1145 - fprintf(out_fp,"%s\t%s\t%s\t%s\t%s\n",msg_h_hits,msg_h_xfer,msg_h_ixfer,
1146 - msg_h_oxfer,msg_h_url);
1147 + fprintf(out_fp,"%s\t%s",msg_h_hits,msg_h_xfer);
1148 + if (dump_inout != 0)
1149 + {
1150 + fprintf(out_fp,"\t%s\t%s",msg_h_ixfer,msg_h_oxfer);
1151 + }
1152 + fprintf(out_fp,"\t%s\n",msg_h_url);
1153 }
1154
1155 /* dump 'em */
1156 @@ -2353,9 +2501,12 @@
1157 uptr=*pointer++;
1158 if (uptr->flag != OBJ_GRP)
1159 {
1160 - fprintf(out_fp,"%llu\t%.0f\t%.0f\t%.0f\t%s\n",
1161 - uptr->count,uptr->xfer/1024,uptr->ixfer/1024,uptr->oxfer/1024,
1162 - uptr->string);
1163 + fprintf(out_fp,"%llu\t%.0f",uptr->count,uptr->xfer/1024);
1164 + if (dump_inout != 0)
1165 + {
1166 + fprintf(out_fp,"\t%.0f\t%.0f",uptr->ixfer/1024,uptr->oxfer/1024);
1167 + }
1168 + fprintf(out_fp,"\t%s\n",uptr->string);
1169 }
1170 cnt--;
1171 }
1172 @@ -2462,9 +2613,12 @@
1173 /* need a header? */
1174 if (dump_header)
1175 {
1176 - fprintf(out_fp,"%s\t%s\t%s\t%s\t%s\t%s\t%s\n",
1177 - msg_h_hits,msg_h_files,msg_h_xfer,msg_h_ixfer,msg_h_oxfer,msg_h_visits,
1178 - msg_h_uname);
1179 + fprintf(out_fp,"%s\t%s\t%s",msg_h_hits,msg_h_files,msg_h_xfer);
1180 + if (dump_inout != 0)
1181 + {
1182 + fprintf(out_fp,"\t%s\t%s",msg_h_ixfer,msg_h_oxfer);
1183 + }
1184 + fprintf(out_fp,"\t%s\t%s\n",msg_h_visits,msg_h_uname);
1185 }
1186
1187 /* dump 'em */
1188 @@ -2474,11 +2628,13 @@
1189 iptr=*pointer++;
1190 if (iptr->flag != OBJ_GRP)
1191 {
1192 - fprintf(out_fp,
1193 - "%llu\t%llu\t%.0f\t%.0f\t%.0f\t%llu\t%s\n",
1194 - iptr->count,iptr->files,iptr->xfer/1024,
1195 - iptr->ixfer/1024,iptr->oxfer/1024,
1196 - iptr->visit,iptr->string);
1197 + fprintf(out_fp,"%llu\t%llu\t%.0f",
1198 + iptr->count,iptr->files,iptr->xfer/1024);
1199 + if (dump_inout != 0)
1200 + {
1201 + fprintf(out_fp,"\t%.0f\t%.0f",iptr->ixfer/1024,iptr->oxfer/1024);
1202 + }
1203 + fprintf(out_fp,"\t%llu\t%s\n",iptr->visit,iptr->string);
1204 }
1205 cnt--;
1206 }
1207 @@ -2602,15 +2758,15 @@
1208 /* month table */
1209 fprintf(out_fp,"<TABLE WIDTH=600 BORDER=2 CELLSPACING=1 CELLPADDING=1>\n");
1210 fprintf(out_fp,"<TR><TH HEIGHT=4></TH></TR>\n");
1211 - fprintf(out_fp,"<TR><TH COLSPAN=13 BGCOLOR=\"%s\" ALIGN=center>",GREY);
1212 + fprintf(out_fp,"<TR><TH COLSPAN=%d BGCOLOR=\"%s\" ALIGN=center>",(dump_inout==0)?11:13,GREY);
1213 fprintf(out_fp,"%s</TH></TR>\n",msg_main_sum);
1214 fprintf(out_fp,"<TR><TH HEIGHT=4></TH></TR>\n");
1215 fprintf(out_fp,"<TR><TH ALIGN=left ROWSPAN=2 BGCOLOR=\"%s\">" \
1216 "<FONT SIZE=\"-1\">%s</FONT></TH>\n",GREY,msg_h_mth);
1217 fprintf(out_fp,"<TH ALIGN=center COLSPAN=4 BGCOLOR=\"%s\">" \
1218 "<FONT SIZE=\"-1\">%s</FONT></TH>\n",GREY,msg_main_da);
1219 - fprintf(out_fp,"<TH ALIGN=center COLSPAN=8 BGCOLOR=\"%s\">" \
1220 - "<FONT SIZE=\"-1\">%s</FONT></TH></TR>\n",GREY,msg_main_mt);
1221 + fprintf(out_fp,"<TH ALIGN=center COLSPAN=%d BGCOLOR=\"%s\">" \
1222 + "<FONT SIZE=\"-1\">%s</FONT></TH></TR>\n",(dump_inout==0)?6:8,GREY,msg_main_mt);
1223 fprintf(out_fp,"<TR><TH ALIGN=center BGCOLOR=\"%s\">" \
1224 "<FONT SIZE=\"-1\">%s</FONT></TH>\n",HITCOLOR,msg_h_hits);
1225 fprintf(out_fp,"<TH ALIGN=center BGCOLOR=\"%s\">" \
1226 @@ -2623,10 +2779,13 @@
1227 "<FONT SIZE=\"-1\">%s</FONT></TH>\n",SITECOLOR,msg_h_sites);
1228 fprintf(out_fp,"<TH ALIGN=center BGCOLOR=\"%s\">" \
1229 "<FONT SIZE=\"-1\">%s</FONT></TH>\n",KBYTECOLOR,msg_h_xfer);
1230 - fprintf(out_fp,"<TH ALIGN=center BGCOLOR=\"%s\">" \
1231 - "<FONT SIZE=\"-1\">%s</FONT></TH>\n",LTBLUE,msg_h_ixfer);
1232 - fprintf(out_fp,"<TH ALIGN=center BGCOLOR=\"%s\">" \
1233 - "<FONT SIZE=\"-1\">%s</FONT></TH>\n",GREEN,msg_h_oxfer);
1234 + if (dump_inout != 0)
1235 + {
1236 + fprintf(out_fp,"<TH ALIGN=center BGCOLOR=\"%s\">" \
1237 + "<FONT SIZE=\"-1\">%s</FONT></TH>\n",LTBLUE,msg_h_ixfer);
1238 + fprintf(out_fp,"<TH ALIGN=center BGCOLOR=\"%s\">" \
1239 + "<FONT SIZE=\"-1\">%s</FONT></TH>\n",GREEN,msg_h_oxfer);
1240 + }
1241 fprintf(out_fp,"<TH ALIGN=center BGCOLOR=\"%s\">" \
1242 "<FONT SIZE=\"-1\">%s</FONT></TH>\n",VISITCOLOR,msg_h_visits);
1243 fprintf(out_fp,"<TH ALIGN=center BGCOLOR=\"%s\">" \
1244 @@ -2657,10 +2816,13 @@
1245 GRPCOLOR,s_year);
1246 fprintf(out_fp,"<TH ALIGN=\"right\" BGCOLOR=\"%s\">" \
1247 "<FONT SIZE=\"-1\">%.0f</TH>", GRPCOLOR, m_xfer);
1248 + if (dump_inout != 0)
1249 + {
1250 fprintf(out_fp,"<TH ALIGN=\"right\" BGCOLOR=\"%s\">" \
1251 "<FONT SIZE=\"-1\">%.0f</TH>", GRPCOLOR, m_ixfer);
1252 fprintf(out_fp,"<TH ALIGN=\"right\" BGCOLOR=\"%s\">" \
1253 "<FONT SIZE=\"-1\">%.0f</TH>", GRPCOLOR, m_oxfer);
1254 + }
1255 fprintf(out_fp,"<TH ALIGN=\"right\" BGCOLOR=\"%s\">" \
1256 "<FONT SIZE=\"-1\">%0llu</TH>", GRPCOLOR, m_visits);
1257 fprintf(out_fp,"<TH ALIGN=\"right\" BGCOLOR=\"%s\">" \
1258 @@ -2675,8 +2837,9 @@
1259 /* Year Header */
1260 s_year=hist[i].year;
1261 if (index_mths>16 && year_hdrs)
1262 - fprintf(out_fp,"<TR><TH COLSPAN=13 BGCOLOR=\"%s\" " \
1263 - "ALIGN=center>%04d</TH></TR>\n", GREY, s_year);
1264 + fprintf(out_fp,"<TR><TH COLSPAN=%d BGCOLOR=\"%s\" " \
1265 + "ALIGN=center>%04d</TH></TR>\n",
1266 + (dump_inout==0)?11:13, GREY, s_year);
1267 }
1268
1269 fprintf(out_fp,"<TR><TD NOWRAP>");
1270 @@ -2701,10 +2864,13 @@
1271 hist[i].site);
1272 fprintf(out_fp,"<TD ALIGN=right><FONT SIZE=\"-1\">%.0f</FONT></TD>\n",
1273 hist[i].xfer);
1274 - fprintf(out_fp,"<TD ALIGN=right><FONT SIZE=\"-1\">%.0f</FONT></TD>\n",
1275 - hist[i].ixfer);
1276 - fprintf(out_fp,"<TD ALIGN=right><FONT SIZE=\"-1\">%.0f</FONT></TD>\n",
1277 - hist[i].oxfer);
1278 + if (dump_inout != 0)
1279 + {
1280 + fprintf(out_fp,"<TD ALIGN=right><FONT SIZE=\"-1\">%.0f</FONT></TD>\n",
1281 + hist[i].ixfer);
1282 + fprintf(out_fp,"<TD ALIGN=right><FONT SIZE=\"-1\">%.0f</FONT></TD>\n",
1283 + hist[i].oxfer);
1284 + }
1285 fprintf(out_fp,"<TD ALIGN=right><FONT SIZE=\"-1\">%llu</FONT></TD>\n",
1286 hist[i].visit);
1287 fprintf(out_fp,"<TD ALIGN=right><FONT SIZE=\"-1\">%llu</FONT></TD>\n",
1288 @@ -2737,10 +2903,13 @@
1289 GRPCOLOR,s_year);
1290 fprintf(out_fp,"<TH ALIGN=\"right\" BGCOLOR=\"%s\">" \
1291 "<FONT SIZE=\"-1\">%.0f</TH>", GRPCOLOR, m_xfer);
1292 + if (dump_inout != 0)
1293 + {
1294 fprintf(out_fp,"<TH ALIGN=\"right\" BGCOLOR=\"%s\">" \
1295 "<FONT SIZE=\"-1\">%.0f</TH>", GRPCOLOR, m_ixfer);
1296 fprintf(out_fp,"<TH ALIGN=\"right\" BGCOLOR=\"%s\">" \
1297 "<FONT SIZE=\"-1\">%.0f</TH>", GRPCOLOR, m_oxfer);
1298 + }
1299 fprintf(out_fp,"<TH ALIGN=\"right\" BGCOLOR=\"%s\">" \
1300 "<FONT SIZE=\"-1\">%0llu</TH>", GRPCOLOR, m_visits);
1301 fprintf(out_fp,"<TH ALIGN=\"right\" BGCOLOR=\"%s\">" \
1302 @@ -2755,10 +2924,13 @@
1303 "<FONT SIZE=\"-1\">%s</FONT></TH>\n",GREY,msg_h_totals);
1304 fprintf(out_fp,"<TH BGCOLOR=\"%s\" ALIGN=right>" \
1305 "<FONT SIZE=\"-1\">%.0f</FONT></TH>\n",GREY,gt_xfer);
1306 - fprintf(out_fp,"<TH BGCOLOR=\"%s\" ALIGN=right>" \
1307 - "<FONT SIZE=\"-1\">%.0f</FONT></TH>\n",GREY,gt_ixfer);
1308 - fprintf(out_fp,"<TH BGCOLOR=\"%s\" ALIGN=right>" \
1309 - "<FONT SIZE=\"-1\">%.0f</FONT></TH>\n",GREY,gt_oxfer);
1310 + if (dump_inout != 0)
1311 + {
1312 + fprintf(out_fp,"<TH BGCOLOR=\"%s\" ALIGN=right>" \
1313 + "<FONT SIZE=\"-1\">%.0f</FONT></TH>\n",GREY,gt_ixfer);
1314 + fprintf(out_fp,"<TH BGCOLOR=\"%s\" ALIGN=right>" \
1315 + "<FONT SIZE=\"-1\">%.0f</FONT></TH>\n",GREY,gt_oxfer);
1316 + }
1317 fprintf(out_fp,"<TH BGCOLOR=\"%s\" ALIGN=right>" \
1318 "<FONT SIZE=\"-1\">%.0f</FONT></TH>\n",GREY,gt_visits);
1319 fprintf(out_fp,"<TH BGCOLOR=\"%s\" ALIGN=right>" \
1320 Index: webalizer/sample.conf
1321 ===================================================================
1322 --- webalizer.orig/sample.conf 2011-01-08 20:36:44.000000000 +0100
1323 +++ webalizer/sample.conf 2011-01-08 20:59:32.000000000 +0100
1324 @@ -444,6 +444,17 @@
1325
1326 #GraphMonths 12
1327
1328 +# Enable Input Output data as reported by apache_logio module.
1329 +# Note for this to work you need the following in your apache configuration
1330 +# LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O" combinedio
1331 +# CustomLog /var/log/apache2/access.log combinedio
1332 +# webalizer can try to be smart and detect whether your log contains logio
1333 +# information or not, to enable this use the 'auto' value.
1334 +# Values can be 'yes','no' or 'auto', the later being the default.
1335 +#
1336 +
1337 +#InOutkB auto
1338 +
1339 # The "Top" options below define the number of entries for each table.
1340 # Defaults are Sites=30, URLs=30, Referrers=30 and Agents=15, and
1341 # Countries=30. TopKSites and TopKURLs (by KByte tables) both default
1342 Index: webalizer/webalizer.c
1343 ===================================================================
1344 --- webalizer.orig/webalizer.c 2011-01-08 20:59:30.000000000 +0100
1345 +++ webalizer/webalizer.c 2011-01-08 20:59:32.000000000 +0100
1346 @@ -202,6 +202,7 @@
1347 int dump_search = 0; /* Search strings */
1348 int dump_header = 0; /* Dump header as first rec */
1349 char *dump_path = NULL; /* Path for dump files */
1350 +int dump_inout = 2; /* In Out kB (logio) 2=auto */
1351
1352 int cur_year=0, cur_month=0, /* year/month/day/hour */
1353 cur_day=0, cur_hour=0, /* tracking variables */
1354 @@ -1450,6 +1451,21 @@
1355 t_visit=tot_visit(sm_htab);
1356 if (ht_hit > mh_hit) mh_hit = ht_hit;
1357
1358 + if(dump_inout == 2) /* auto display InOutKb? */
1359 + {
1360 + /* check with monthly totals */
1361 + /* if some In Out totals are not 0, enable displaying them */
1362 + /* else hide them*/
1363 + if((t_ixfer != 0) && (t_oxfer != 0))
1364 + {
1365 + dump_inout = 1;
1366 + }
1367 + else
1368 + {
1369 + dump_inout = 0;
1370 + }
1371 + }
1372 +
1373 if (total_rec > (total_ignore+total_bad)) /* did we process any? */
1374 {
1375 if (incremental)
1376 @@ -1647,7 +1663,8 @@
1377 "YearTotals", /* show year subtotals (0=no) 117 */
1378 "CountryFlags", /* show country flags? (0-no) 118 */
1379 "FlagDir", /* directory w/flag images 119 */
1380 - "SearchCaseI" /* srch str case insensitive 120 */
1381 + "SearchCaseI", /* srch str case insensitive 120 */
1382 + "InOutkB" /* logio (0=no,1=yes,2=auto) 121 */
1383 };
1384
1385 FILE *fp;
1386 @@ -1882,6 +1899,9 @@
1387 case 119: use_flags=1; flag_dir=save_opt(value); break; /* FlagDir */
1388 case 120: searchcasei=
1389 (tolower(value[0])=='n')?0:1; break; /* SearchCaseI */
1390 + case 121: dump_inout=
1391 + (tolower(value[0])=='n')?0:
1392 + (tolower(value[0])=='y')?1:2; break; /* InOutkB */
1393 }
1394 }
1395 fclose(fp);
1396 Index: webalizer/webalizer.h
1397 ===================================================================
1398 --- webalizer.orig/webalizer.h 2011-01-08 20:59:30.000000000 +0100
1399 +++ webalizer/webalizer.h 2011-01-08 20:59:32.000000000 +0100
1400 @@ -246,6 +246,7 @@
1401 extern int dump_search ; /* Search strings */
1402 extern int dump_header ; /* Dump header as first rec */
1403 extern char *dump_path ; /* Path for dump files */
1404 +extern int dump_inout ; /* In Out kB (logio) 2=auto */
1405
1406 extern u_int64_t cur_tstamp; /* Current timestamp */
1407 extern u_int64_t epoch; /* used for timestamp adj. */