From 4c53bb6ed0b77d02b83d1e6a2a4c81479dafe4bd Mon Sep 17 00:00:00 2001 From: Robert Anderson <randerson@lbsd.net> Date: Thu, 27 Jan 2011 10:10:38 +0000 Subject: [PATCH] Small fixes Use integer instead of string when using Math::BigInt Fixed comment for post accounting hook --- smradius/modules/accounting/mod_accounting_sql.pm | 10 +++++----- smradiusd | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/smradius/modules/accounting/mod_accounting_sql.pm b/smradius/modules/accounting/mod_accounting_sql.pm index e3b8122e..16b76bc8 100644 --- a/smradius/modules/accounting/mod_accounting_sql.pm +++ b/smradius/modules/accounting/mod_accounting_sql.pm @@ -399,8 +399,8 @@ sub getUsage # Rounding up my %res; - $res{'TotalDataUsage'} = $totalData->bdiv('1024')->bdiv('1024')->bceil()->bstr(); - $res{'TotalSessionTime'} = $totalTime->bdiv('60')->bceil()->bstr(); + $res{'TotalDataUsage'} = $totalData->bdiv(1024)->bdiv(1024)->bceil()->bstr(); + $res{'TotalSessionTime'} = $totalTime->bdiv(60)->bceil()->bstr(); # If we using caching and got here, it means that we must cache the result if (defined($config->{'accounting_usage_cache_time'})) { @@ -800,9 +800,9 @@ sub cleanup # Rounding up my $res; - $res->{'TotalDataInput'} = $totalDataInput->bdiv('1024')->bdiv('1024')->bceil()->bstr(); - $res->{'TotalDataOutput'} = $totalDataOutput->bdiv('1024')->bdiv('1024')->bceil()->bstr(); - $res->{'TotalSessionTime'} = $totalTime->bdiv('60')->bceil()->bstr(); + $res->{'TotalDataInput'} = $totalDataInput->bdiv(1024)->bdiv(1024)->bceil()->bstr(); + $res->{'TotalDataOutput'} = $totalDataOutput->bdiv(1024)->bdiv(1024)->bceil()->bstr(); + $res->{'TotalSessionTime'} = $totalTime->bdiv(60)->bceil()->bstr(); @dbDoParams = (' INSERT INTO diff --git a/smradiusd b/smradiusd index ed3a55d1..db63402d 100755 --- a/smradiusd +++ b/smradiusd @@ -714,7 +714,7 @@ sub process_request { # Are we going to POD the user? my $PODUser = 0; - # Loop with modules that have post-authentication hooks + # Loop with modules that have post-accounting hooks foreach my $module (@{$self->{'module_list'}}) { # Try authenticate if ($module->{'Feature_Post-Accounting_hook'}) { -- GitLab