summaryrefslogtreecommitdiffstats
path: root/etc
diff options
context:
space:
mode:
authorChris Buechler <cmb@pfsense.org>2015-12-17 16:17:59 -0600
committerChris Buechler <cmb@pfsense.org>2015-12-17 16:17:59 -0600
commit7c4b3b2060c291a9c166d8196d053afac97861af (patch)
tree7fd4dcb1e8ad72d788911a0ea2b1b73663d3c98a /etc
parentfc02b11a9dde02f567b96dfb1e9b98a17b609d6c (diff)
downloadpfsense-7c4b3b2060c291a9c166d8196d053afac97861af.zip
pfsense-7c4b3b2060c291a9c166d8196d053afac97861af.tar.gz
Add busytimeout of 60 seconds for CP database access. This matches the default value PHP uses with sqlite 2.x versions (pfSense 2.1.x and earlier) and prevents the issues noted in Ticket #5622
Diffstat (limited to 'etc')
-rw-r--r--etc/inc/captiveportal.inc4
1 files changed, 4 insertions, 0 deletions
diff --git a/etc/inc/captiveportal.inc b/etc/inc/captiveportal.inc
index 497b6f1..5e834ca 100644
--- a/etc/inc/captiveportal.inc
+++ b/etc/inc/captiveportal.inc
@@ -1340,11 +1340,13 @@ function captiveportal_opendb() {
try {
$DB = new SQLite3($db_path);
+ $DB->busyTimeout(60000);
} catch (Exception $e) {
captiveportal_syslog("Could not open {$db_path} as an sqlite database for {$cpzone}. Error message: " . $e->getMessage() . " -- Trying again.");
unlink_if_exists($db_path);
try {
$DB = new SQLite3($db_path);
+ $DB->busyTimeout(60000);
} catch (Exception $e) {
captiveportal_syslog("Still could not open {$db_path} as an sqlite database for {$cpzone}. Error message: " . $e->getMessage() . " -- Remove the database file manually and ensure there is enough free space.");
return;
@@ -1355,6 +1357,7 @@ function captiveportal_opendb() {
captiveportal_syslog("Could not open {$db_path} as an sqlite database for {$cpzone}. Error message: {$DB->lastErrorMsg()}. Trying again.");
unlink_if_exists($db_path);
$DB = new SQLite3($db_path);
+ $DB->busyTimeout(60000);
if (!$DB) {
captiveportal_syslog("Still could not open {$db_path} as an sqlite database for {$cpzone}. Error message: {$DB->lastErrorMsg()}. Remove the database file manually and ensure there is enough free space.");
return;
@@ -1369,6 +1372,7 @@ function captiveportal_opendb() {
unset($DB);
unlink_if_exists($db_path);
$DB = new SQLite3($db_path);
+ $DB->busyTimeout(60000);
if ($DB->exec($createquery)) {
captiveportal_syslog("Successfully reinitialized tables for {$cpzone} -- database has been reset.");
} else {
OpenPOWER on IntegriCloud