Fix bug regarding codec engine configuration. AllocateAVP and Message didn't do it.
[anna.git] / source / diameter / codec / Avp.cpp
index bb65e38..f35cca8 100644 (file)
@@ -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);