From c26fc8bb26fcacb23740c1c320fc8f6b6845c3da Mon Sep 17 00:00:00 2001 From: Dmitriy Simushev Date: Mon, 1 Oct 2012 14:55:17 +0000 Subject: [PATCH] Fix early return from RequestProcessor::processRequest --- .../webim/libs/classes/request_processor.php | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/messenger/webim/libs/classes/request_processor.php b/src/messenger/webim/libs/classes/request_processor.php index 5128bc3b..5433bcdf 100644 --- a/src/messenger/webim/libs/classes/request_processor.php +++ b/src/messenger/webim/libs/classes/request_processor.php @@ -139,14 +139,14 @@ abstract class RequestProcessor { ? array() : $callback['arguments']; call_user_func_array($function, array($arguments)); - return true; + continue; } else { // Try to get result function $result_function = $this->mibewAPI->getResultFunction($request['functions']); if (! is_null($result_function)) { // There is result function but no callback - return true; + continue; } // There is no result function @@ -170,10 +170,13 @@ abstract class RequestProcessor { } } - if ($request_package['async']) { - $this->sendAsyncResponses($this->responses); - } else { - $this->sendSyncResponses($this->responses); + if (count($this->responses) != 0) { + // Send responses + if ($request_package['async']) { + $this->sendAsyncResponses($this->responses); + } else { + $this->sendSyncResponses($this->responses); + } } // Output response