From a786b755eb828726c8db333b00865432933bcf24 Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Thu, 19 Jul 2012 14:06:47 +0200 Subject: [PATCH] calamaris: Make decompressing large logs more memory-friendly. Thanks to Roger Devaux for reporting and testing. Calamaris is now able to process big log files consuming about 10M or RAM (was several gigabytes before). --- config/calamaris/mkreport | 4 ++-- config/rootfiles/core/61/filelists/files | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/config/calamaris/mkreport b/config/calamaris/mkreport index 53db9d571..ee831624c 100644 --- a/config/calamaris/mkreport +++ b/config/calamaris/mkreport @@ -94,7 +94,7 @@ sub processlogfiles { if ($filestr =~ /access\.log/) { open (LOG,"gzip -dc $filestr |"); - foreach () { + while () { if (substr($_,0,10) >= $date_from) { if (substr($_,0,10) <= $date_to) { print TMPLOG "$_"; } } } close(LOG); @@ -106,7 +106,7 @@ sub processlogfiles { if ($filestr =~ /access\.log/) { open (LOG,$filestr); - foreach () { + while () { if (substr($_,0,10) >= $date_from) { if (substr($_,0,10) <= $date_to) { print TMPLOG "$_"; } } } close(LOG); diff --git a/config/rootfiles/core/61/filelists/files b/config/rootfiles/core/61/filelists/files index 396a27f7a..1466fef82 100644 --- a/config/rootfiles/core/61/filelists/files +++ b/config/rootfiles/core/61/filelists/files @@ -8,5 +8,6 @@ srv/web/ipfire/cgi-bin/ovpnmain.cgi srv/web/ipfire/cgi-bin/proxy.cgi var/ipfire/general-functions.pl var/ipfire/langs +var/ipfire/proxy/calamaris/bin/mkreport usr/local/bin/getconntracktable usr/sbin/redirect_wrapper -- 2.39.2