summaryrefslogtreecommitdiff
path: root/program
diff options
context:
space:
mode:
authorAleksander Machniak <alec@alec.pl>2015-02-25 21:08:16 +0100
committerAleksander Machniak <alec@alec.pl>2015-02-25 21:08:16 +0100
commit2a31f6dbd7c63232918d175fb2879682217946ea (patch)
treef80f4b0e08ba3e39d9056cdf3e9bd2959a52074d /program
parente1c8fe5c4a0f30cd36069e3460ac937282fb8e1a (diff)
Reset default db_max_allowed_packet, fix max packet size detection
Diffstat (limited to 'program')
-rw-r--r--program/lib/Roundcube/rcube_cache.php6
-rw-r--r--program/lib/Roundcube/rcube_cache_shared.php6
2 files changed, 8 insertions, 4 deletions
diff --git a/program/lib/Roundcube/rcube_cache.php b/program/lib/Roundcube/rcube_cache.php
index 52a2db997..303abdac4 100644
--- a/program/lib/Roundcube/rcube_cache.php
+++ b/program/lib/Roundcube/rcube_cache.php
@@ -605,8 +605,10 @@ class rcube_cache
$this->max_packet = 2097152; // default/max is 2 MB
if ($this->type == 'db') {
- $value = $this->db->get_variable('max_allowed_packet', $this->max_packet);
- $this->max_packet = max($value, $this->max_packet) - 2000;
+ if ($value = $this->db->get_variable('max_allowed_packet', $this->max_packet)) {
+ $this->max_packet = $value;
+ }
+ $this->max_packet -= 2000;
}
else if ($this->type == 'memcache') {
$stats = $this->db->getStats();
diff --git a/program/lib/Roundcube/rcube_cache_shared.php b/program/lib/Roundcube/rcube_cache_shared.php
index 339a9aa20..3f0f20e41 100644
--- a/program/lib/Roundcube/rcube_cache_shared.php
+++ b/program/lib/Roundcube/rcube_cache_shared.php
@@ -595,8 +595,10 @@ class rcube_cache_shared
$this->max_packet = 2097152; // default/max is 2 MB
if ($this->type == 'db') {
- $value = $this->db->get_variable('max_allowed_packet', 1048500);
- $this->max_packet = min($value, $this->max_packet) - 2000;
+ if ($value = $this->db->get_variable('max_allowed_packet', $this->max_packet)) {
+ $this->max_packet = $value;
+ }
+ $this->max_packet -= 2000;
}
else if ($this->type == 'memcache') {
$stats = $this->db->getStats();