X-Git-Url: https://git.teslayout.com/public/public/public/?a=blobdiff_plain;f=source%2Fdiameter%2Fcodec%2FMessage.cpp;h=6593dd4626d22472995683a626ef1108abddf2d3;hb=8a83c3072f9c073ad0b29e79c19ca88e1ac636d9;hp=049e85a2bc20b22d6aa07df9c00f4382e5fe5116;hpb=6a05cda7553cf39d5b14539f9f4b9cf829c156a6;p=anna.git diff --git a/source/diameter/codec/Message.cpp b/source/diameter/codec/Message.cpp index 049e85a..6593dd4 100644 --- a/source/diameter/codec/Message.cpp +++ b/source/diameter/codec/Message.cpp @@ -124,7 +124,7 @@ void Message::initialize() throw() { //------------------------------------------------------------------------------ //------------------------------------------------------------- Message::clear() //------------------------------------------------------------------------------ -void Message::clear() throw(anna::RuntimeException) { +void Message::clear(bool resetEngine) throw(anna::RuntimeException) { for(avp_iterator it = avp_begin(); it != avp_end(); it++) { /*avp(it)->clear(); */getEngine()->releaseAvp(Avp::avp(it)); } a_avps.clear(); @@ -133,6 +133,7 @@ void Message::clear() throw(anna::RuntimeException) { a_finds.clear(); // Initialize: initialize(); + if (resetEngine) a_engine = NULL; } @@ -227,6 +228,7 @@ void Message::setApplicationId(U32 aid) throw(anna::RuntimeException) { // Codec engine manager (a multithreaded application, normally does not achieve this point, because // messages are prepared for each interface with the corresponding codec engine) anna::diameter::codec::EngineManager &em = anna::diameter::codec::EngineManager::instantiate(); + if (em.size() == 0) return; if (em.selectFromApplicationId()) { Engine *monostackEngine = em.getMonoStackCodecEngine(); if (monostackEngine) { a_engine = monostackEngine; return; } @@ -303,7 +305,7 @@ void Message::decode(const anna::DataBlock &db, Message *ptrAnswer) throw(anna:: trace += db.asString(); anna::Logger::debug(trace, ANNA_FILE_LOCATION); ); - clear(); + clear(false /* respect engine */); // EXCEPTION MANAGEMENT IN THIS METHOD // =================================== // DECODE PHASE @@ -773,7 +775,7 @@ void Message::fromXML(const anna::xml::Node* messageNode) throw(anna::RuntimeExc unsigned int u_aux; // Clear the message - clear(); + clear(false /* respect engine */); if(version) { i_aux = version->getIntegerValue();