X-Git-Url: https://git.teslayout.com/public/public/public/?a=blobdiff_plain;f=example%2Fdiameter%2Flauncher%2FProgrammedAnswers.cpp;h=8e310d72a4160d3b994b8d4c783144ad083b5229;hb=fad7b1cb36dc9d5de0a7b775fdfb82778a693102;hp=5f6dd4f3d9e0e860026a6419cd302020ac0f3005;hpb=752438861433c3789eb1b0d9f2c15e15037595e6;p=anna.git diff --git a/example/diameter/launcher/ProgrammedAnswers.cpp b/example/diameter/launcher/ProgrammedAnswers.cpp index 5f6dd4f..8e310d7 100644 --- a/example/diameter/launcher/ProgrammedAnswers.cpp +++ b/example/diameter/launcher/ProgrammedAnswers.cpp @@ -19,8 +19,7 @@ void ProgrammedAnswers::clear () throw() { for (reacting_answers_const_iterator it = a_deques.begin(); it != a_deques.end(); it++) { - anna::diameter::codec::Engine *engine = anna::functions::component (ANNA_FILE_LOCATION); - engine->releaseMessage(*(it->second->begin())); + a_codecEngine->releaseMessage(*(it->second->begin())); delete(it->second); } a_deques.clear(); @@ -46,6 +45,9 @@ void ProgrammedAnswers::dump () throw() { } void ProgrammedAnswers::addMessage(int code, anna::diameter::codec::Message *message) throw() { + if (!message) return; // just in case + message->setEngine(a_codecEngine); // just in case + reacting_answers_const_iterator it = a_deques.find(code); if (it != a_deques.end()) { it->second->push_back(message); @@ -70,12 +72,11 @@ void ProgrammedAnswers::nextMessage(int code) throw() { //pops the deque and rel reacting_answers_const_iterator it = a_deques.find(code); if (it != a_deques.end()) { if (!it->second->empty()) { - anna::diameter::codec::Engine *engine = anna::functions::component (ANNA_FILE_LOCATION); if (a_rotate) { addMessage(code, *(it->second->begin())); } else { - engine->releaseMessage(*(it->second->begin())); + a_codecEngine->releaseMessage(*(it->second->begin())); } it->second->pop_front(); } @@ -89,6 +90,8 @@ std::string ProgrammedAnswers::asString(const char *queueName) const throw() { aux += "', Rotation "; aux += a_rotate ? "enabled":"disabled"; result += anna::functions::highlightJustify(aux); + result += "Codec engine: "; + result += a_codecEngine->getClassName(); if(a_deques.size() != 0) { for(reacting_answers_const_iterator it = a_deques.begin(); it != a_deques.end(); it++) { if (it->second->size() != 0) {