summaryrefslogtreecommitdiffstats
path: root/src/etc
diff options
context:
space:
mode:
authorChris Buechler <cmb@pfsense.org>2015-12-17 16:21:22 -0600
committerChris Buechler <cmb@pfsense.org>2015-12-17 16:21:22 -0600
commit18ca572b3aa38457e44fb8a67348f95835ee9827 (patch)
treede6003784bc572dc8fbb1cce497c1eca6b984c6c /src/etc
parent60aa5b5218a9c7d0fc627614edc35585ed1e5bf9 (diff)
downloadpfsense-18ca572b3aa38457e44fb8a67348f95835ee9827.zip
pfsense-18ca572b3aa38457e44fb8a67348f95835ee9827.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 'src/etc')
-rw-r--r--src/etc/inc/captiveportal.inc4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/etc/inc/captiveportal.inc b/src/etc/inc/captiveportal.inc
index 6be3ba4..5449d93 100644
--- a/src/etc/inc/captiveportal.inc
+++ b/src/etc/inc/captiveportal.inc
@@ -1406,11 +1406,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;
@@ -1421,6 +1423,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;
@@ -1435,6 +1438,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