X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=sidebyside;f=lib%2Fstompqueuemanager.php;h=25a8e2a27ebaef546bfa6ea7017c83dd7583a709;hb=046d070ad46bb58096664dabb6f7c13a062d847d;hp=fc98c77d4086cffea3a90076790c19f39f8bbced;hpb=ae696728f5edf8972c68c17ce9ea21f07d44cbed;p=quix0rs-gnu-social.git diff --git a/lib/stompqueuemanager.php b/lib/stompqueuemanager.php index fc98c77d40..25a8e2a27e 100644 --- a/lib/stompqueuemanager.php +++ b/lib/stompqueuemanager.php @@ -480,6 +480,13 @@ class StompQueueManager extends QueueManager { $host = $this->cons[$this->defaultIdx]->getServer(); $message = unserialize($frame->body); + + if ($message === false) { + $this->_log(LOG_ERR, "Can't unserialize frame: {$frame->body}"); + $this->_log(LOG_ERR, "Unserializable frame length: " . strlen($frame->body)); + return false; + } + $site = $message['site']; $queue = $message['handler']; @@ -491,8 +498,9 @@ class StompQueueManager extends QueueManager // @fixme detect failing site switches $this->switchSite($site); - $item = $this->decode($message['payload']); - if (empty($item)) { + try { + $item = $this->decode($message['payload']); + } catch (Exception $e) { $this->_log(LOG_ERR, "Skipping empty or deleted item in queue $queue from $host"); $this->stats('baditem', $queue); return false; @@ -578,7 +586,7 @@ class StompQueueManager extends QueueManager function incDeliveryCount($msgId) { $count = 0; - $cache = common_memcache(); + $cache = Cache::instance(); if ($cache) { $key = 'statusnet:stomp:message-retries:' . $msgId; $count = $cache->increment($key); @@ -649,7 +657,7 @@ class StompQueueManager extends QueueManager */ protected function updateSiteConfig($nickname) { - $sn = Status_network::staticGet('nickname', $nickname); + $sn = Status_network::getKV('nickname', $nickname); if ($sn) { $this->switchSite($nickname); if (!in_array($nickname, $this->sites)) {