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