]> git.mxchange.org Git - hub.git/blobdiff - application/hub/main/handler/message-types/requests/class_NodeMessageRequestNodeListHandler.php
Added line numbers to debug lines as this will become the 'norm'
[hub.git] / application / hub / main / handler / message-types / requests / class_NodeMessageRequestNodeListHandler.php
index c52a4df438c7d892ae69faa3f161e114b5f6a087..143afbd22945f3d02bd738fb592ebf6c73141f4f 100644 (file)
@@ -119,26 +119,28 @@ class NodeMessageRequestNodeListHandler extends BaseMessageHandler implements Ha
         */
        protected function initMessageConfigurationData (array $messageData) {
                // Debug message
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(' REQUEST-HANDLER: messageData=' . print_r($messageData, true));
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(' REQUEST-HANDLER[' . __LINE__ . ']: messageData=' . print_r($messageData, true));
 
                // "Walk" throught the config-copy array
                foreach ($this->configCopy as $targetKey => $sourceKey) {
                        // Debug message
-                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('REQUEST-HANDLER: Copying from sourceKey=' . $sourceKey . ' to targetKey=' . $targetKey . '...');
+                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('REQUEST-HANDLER[' . __LINE__ . ']: Copying from sourceKey=' . $sourceKey . ' to targetKey=' . $targetKey . '...');
 
                        // Copy from source to targetKey
                        $this->getConfigInstance()->setConfigEntry($targetKey, $this->getConfigInstance()->getConfigEntry($sourceKey));
                } // END - foreach
 
+               // Query local DHT for nodes except given session id
+               $nodeList = $this->getDhtInstance()->queryLocalNodeListExceptByMessageData($messageData, $this, XmlRequestNodeListTemplateEngine::REQUEST_DATA_SESSION_ID, XmlRequestNodeListTemplateEngine::REQUEST_DATA_ACCEPTED_OBJECT_TYPES, BaseHubNode::OBJECT_LIST_SEPARATOR);
+
+               // Set it serialized in configuration (temporarily)
+               $this->getConfigInstance()->setConfigEntry('node_list', base64_encode(serialize($nodeList)));
+
                // Translate last exception into a status code
                $statusCode = $this->getTranslatedStatusFromLastException();
 
                // Set it in configuration (temporarily)
                $this->getConfigInstance()->setConfigEntry('answer_status', $statusCode);
-
-               // Query local DHT for nodes except given session id
-               $nodeList = $this->getDhtInstance()->queryLocalNodeListExceptByMessageData($messageData, XmlRequestNodeListTemplateEngine::REQUEST_DATA_SESSION_ID, XmlRequestNodeListTemplateEngine::REQUEST_DATA_ACCEPTED_OBJECT_TYPES, ',');
-               die('nodeList='.print_r($nodeList, true));
        }
 
        /**