Aleksander Machniak
2015-02-25 2a31f6dbd7c63232918d175fb2879682217946ea
Reset default db_max_allowed_packet, fix max packet size detection
3 files modified
14 ■■■■■ changed files
config/defaults.inc.php 2 ●●● patch | view | raw | blame | history
program/lib/Roundcube/rcube_cache.php 6 ●●●●● patch | view | raw | blame | history
program/lib/Roundcube/rcube_cache_shared.php 6 ●●●●● patch | view | raw | blame | history
config/defaults.inc.php
@@ -55,7 +55,7 @@
// Use them if your server is not MySQL or for better performance.
// For example Roundcube uses max_allowed_packet value (in bytes)
// which limits query size for database cache operations.
$config['db_max_allowed_packet'] = 23423440;
$config['db_max_allowed_packet'] = null;
// ----------------------------------
program/lib/Roundcube/rcube_cache.php
@@ -605,8 +605,10 @@
            $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();
program/lib/Roundcube/rcube_cache_shared.php
@@ -595,8 +595,10 @@
            $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();