Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
smradius
smradius
Commits
0868c9bc
Commit
0868c9bc
authored
May 15, 2019
by
Nigel Kukard
Browse files
Handle NULL's received from the DB a bit more sanely with the newer Math::BigInt
parent
6a79baab
Changes
1
Hide whitespace changes
Inline
Side-by-side
lib/smradius/modules/accounting/mod_accounting_sql.pm
View file @
0868c9bc
...
...
@@ -532,6 +532,14 @@ sub acct_log
qw(AcctInputOctets AcctInputPackets AcctOutputOctets AcctOutputPackets AcctInputGigawords AcctOutputGigawords
SessionTime PeriodKey)
))
{
# Make sure we treat undef values sort of sanely
$sessionPart
->
{'
AcctInputGigawords
'}
//
=
0
;
$sessionPart
->
{'
AcctInputOctets
'}
//
=
0
;
$sessionPart
->
{'
AcctOutputGigawords
'}
//
=
0
;
$sessionPart
->
{'
AcctOutputOctets
'}
//
=
0
;
$sessionPart
->
{'
AcctInputPackets
'}
//
=
0
;
$sessionPart
->
{'
AcctOutputPackets
'}
//
=
0
;
$sessionPart
->
{'
AcctSessionTime
'}
//
=
0
;
# Convert this session usage to bytes
my
$sessionInputBytes
=
Math::
BigInt
->
new
(
0
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment