Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Projets publics
Sympa
Commits
cca74db3
Commit
cca74db3
authored
Jul 26, 2021
by
IKEDA Soji
Browse files
Small fix: Aborted connection may crash the process.
parent
2cdbd451
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/lib/Sympa/Database.pm
View file @
cca74db3
...
...
@@ -8,8 +8,8 @@
# Copyright (c) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
# 2006, 2007, 2008, 2009, 2010, 2011 Comite Reseau des Universites
# Copyright (c) 2011, 2012, 2013, 2014, 2015, 2016, 2017 GIP RENATER
# Copyright 2017, 2018, 2019 The Sympa Community. See the
AUTHORS.md file at
# the top-level directory of this distribution and at
# Copyright 2017, 2018, 2019
, 2021
The Sympa Community. See the
#
AUTHORS.md file at
the top-level directory of this distribution and at
# <https://github.com/sympa-community/sympa.git>.
#
# This program is free software; you can redistribute it and/or modify
...
...
@@ -108,6 +108,13 @@ sub connect {
$self
);
return
1
;
}
# Disconnected: Transaction (if any) was aborted.
if
(
delete
$self
->
{
_sdbTransactionLevel
})
{
$log
->
syslog
('
err
',
'
Transaction on database %s was aborted: %s
',
$self
,
$
DBI::
errstr
);
$self
->
set_persistent
(
$self
->
{
_sdbPrevPersistency
});
return
undef
;
}
# Do we have required parameters?
foreach
my
$param
(
@
{
$self
->
required_parameters
})
{
...
...
@@ -425,6 +432,9 @@ sub begin {
sub
_finalize_transaction
{
my
$self
=
shift
;
unless
(
defined
$self
->
{
_sdbTransactionLevel
})
{
return
;
}
unless
(
$self
->
{
_sdbTransactionLevel
})
{
die
'
bug in logic. Ask developer
';
}
...
...
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