From: Eduardo Ramos Testillano Date: Mon, 8 Jun 2015 15:35:49 +0000 (+0200) Subject: Fix bug regarding codec engine configuration. AllocateAVP and Message didn't do it. X-Git-Tag: REFACTORING_TESTING_LIBRARY~129 X-Git-Url: https://git.teslayout.com/public/public/public/?a=commitdiff_plain;h=7b40224bccc5d695c2977022b92e94715464c395;p=anna.git Fix bug regarding codec engine configuration. AllocateAVP and Message didn't do it. --- diff --git a/source/diameter/codec/Avp.cpp b/source/diameter/codec/Avp.cpp index bb65e38..f35cca8 100644 --- a/source/diameter/codec/Avp.cpp +++ b/source/diameter/codec/Avp.cpp @@ -180,7 +180,7 @@ avp_iterator Avp::avp_find(avp_container &avps, AvpId id, unsigned int position) //---------------------------------------------------------------- Avp::addAvp() //------------------------------------------------------------------------------ Avp * Avp::addAvp(avp_container &avps, int &insertionPositionForChilds, AvpId id, Engine *engine) throw() { - Avp * result = engine->allocateAvp(); + Avp * result = engine->createAvp(NULL); result->setId(id); addChild(avps, insertionPositionForChilds, result); return result; @@ -667,7 +667,7 @@ void Avp::decodeDataPart(const char * buffer, int size, const parent_t & parent, while(avpPos < size) { try { - avp = getEngine()->allocateAvp(); + avp = getEngine()->createAvp(NULL); db.assign(buffer + avpPos, size - avpPos /* is valid to pass total size (indeed i don't know the real avp size) because it will be limited and this has deep copy disabled (no memory is reserved) */); avp -> decode(db, me, answer); } catch(anna::RuntimeException &ex) { @@ -1505,7 +1505,7 @@ void Avp::fromXML(const anna::xml::Node* avpNode) throw(anna::RuntimeException) } try { - avp = getEngine()->allocateAvp(); + avp = getEngine()->createAvp(NULL); avp -> fromXML(*it); } catch(anna::RuntimeException &ex) { getEngine()->releaseAvp(avp); diff --git a/source/diameter/codec/Message.cpp b/source/diameter/codec/Message.cpp index 51a5218..2726992 100644 --- a/source/diameter/codec/Message.cpp +++ b/source/diameter/codec/Message.cpp @@ -366,7 +366,7 @@ void Message::decode(const anna::DataBlock &db, Message *ptrAnswer) throw(anna:: while(avpPos < dataBytes) { try { - avp = getEngine()->allocateAvp(); + avp = getEngine()->createAvp(NULL); db_aux.assign(startData + avpPos, dataBytes - avpPos /* is valid to pass total length (indeed i don't know the real avp length) because it will be limited and this has deep copy disabled (no memory is reserved) */); avp -> decode(db_aux, parent, answer); } catch(anna::RuntimeException &ex) { @@ -891,7 +891,7 @@ void Message::fromXML(const anna::xml::Node* messageNode) throw(anna::RuntimeExc } try { - avp = getEngine()->allocateAvp(); + avp = getEngine()->createAvp(NULL); avp -> fromXML(*it); } catch(anna::RuntimeException &ex) { getEngine()->releaseAvp(avp);