Message cleared on demand (if you want to reuse and the codec engine may be different)
[anna.git] / source / diameter / codec / Message.cpp
index b5d87f6..049e85a 100644 (file)
@@ -191,9 +191,7 @@ bool Message::flagsOK(int &rc) const throw() {
 //------------------------------------------------------------------------------
 //------------------------------------------------------------- Message::setId()
 //------------------------------------------------------------------------------
-void Message::setId(CommandId id, bool _clear) throw(anna::RuntimeException) {
-  // Clear class content:
-  if(_clear) clear();
+void Message::setId(CommandId id) throw(anna::RuntimeException) {
 
   // Id assignment:
   a_id = id;
@@ -822,7 +820,8 @@ void Message::fromXML(const anna::xml::Node* messageNode) throw(anna::RuntimeExc
       throw anna::RuntimeException(msg, ANNA_FILE_LOCATION);
     }
 
-    setId(stackCommand->getId(), false /* don't clear */);
+    setId(stackCommand->getId());
+
     // 'P', 'E' and 'T' flags:
     bool activateP = pbit ? (pbit->getValue() == "yes") : false;
     bool activateE = ebit ? (ebit->getValue() == "yes") : false;