From 2a31f6dbd7c63232918d175fb2879682217946ea Mon Sep 17 00:00:00 2001 From: Aleksander Machniak Date: Wed, 25 Feb 2015 21:08:16 +0100 Subject: Reset default db_max_allowed_packet, fix max packet size detection --- program/lib/Roundcube/rcube_cache.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'program/lib/Roundcube/rcube_cache.php') 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(); -- cgit v1.2.3