Patch for Innreport (sum of all incoming connections)
Russ Allbery
rra at stanford.edu
Wed Nov 22 08:42:46 UTC 2006
Julien ÉLIE <julien at trigofacile.com> writes:
> Hi,
> We discussed a bit of that in « news.software.nntp »
> (Innreport fails to log everything).
> I have released a patch which includes the modifications
> done in <http://members.ll.net/supraexpress/>.
> Here it is: <http://people.via.ecp.fr/~iulius/inn2/>.
> I have successfully tested it (with stable Debian Sarge version of INN
> 2.4.2).
> The patch for version 2.4.2 is « *.diff ».
> Regarding version 2.5, it is « *.CURRENT.diff » since there was a change
> in it (rejected_size was added).
> It should normally work (not tested). Simply do « scanlogs norotate » and
> see whether numbers are displayed :)
There were a few problems with this:
* There's no need to add the separate EOF flag, and it may be incorrect
if one is reporting on multiple logs together. Instead, observe that
we only care about the checkpoint numbers if we don't see a close after
the checkpoint. Therefore, just reset the checkpoint numbers to 0
whenever we see a close, and at the end of processing, we can just add
all of the checkpoint numbers to the totals (and they may be zero).
* There were several places where the code was adding or assigning based
on whether the key already had a value. This isn't necessary; you can
add to a non-existent key and it will do the right thing.
* There were many lines over 80 characters. INN coding style says to
always keep lines under 80 characters.
I've fixed those problems and committed this patch to CURRENT. I've not
tested it yet; I'm going to let it age on CURRENT for a while before
committing it to STABLE, but I suppose it should also be in the next
STABLE release.
Thank you!
--
Russ Allbery (rra at stanford.edu) <http://www.eyrie.org/~eagle/>
More information about the inn-patches
mailing list