a_number = testCase->steps() + 1; // testCase is not NULL
}
-bool TestStep::decodeMessage() throw() {
+bool TestStep::decodeMessage(bool trust) throw() {
if (a_messageCodec) return true;
a_messageCodec = new anna::diameter::codec::Message;
if (::decodeMessage(a_message, *a_messageCodec)) return true;
+ if (trust) return true;
delete a_messageCodec;
a_messageCodec = NULL;
// Detailed log:
if(a_originHost->logEnabled()) {
- //if (decodeMessage()) {
- // here we decode what we encoded on programming, then we could have a validation problem but not a decoding one:
- decodeMessage();
+ if (decodeMessage(true /* trust */)) {
std::string detail = usedClientSession ? usedClientSession->asString() : "<null client session>"; // shouldn't happen
a_originHost->writeLogFile(*a_messageCodec, (success ? "sent2e" : "send2eError"), detail);
- //}
+ }
}
}
else if (getType() == Type::Sendxml2c) {
// Detailed log:
if(a_originHost->logEnabled()) {
- //if (decodeMessage()) {
- // here we decode what we encoded on programming, then we could have a validation problem but not a decoding one:
- decodeMessage();
+ if (decodeMessage(true /* trust */)) {
std::string detail = usedServerSession ? usedServerSession->asString() : "<null server session>"; // shouldn't happen
a_originHost->writeLogFile(*a_messageCodec, (success ? "sent2c" : "send2cError"), detail);
- //}
+ }
}
}
// Message (not for all step types)
anna::DataBlock a_message;
anna::diameter::codec::Message *a_messageCodec; // used as helper and for traffic logs
- bool decodeMessage() throw();
+ bool decodeMessage(bool trust = false) throw(); // If trust=true: decoding the previously encoded message (sendxml sentences).
+ // The only error would be validation ones, and we are going to ignore them here.
virtual bool do_execute() throw() = 0; // returns true if next step must be executed
virtual void do_complete() throw() = 0; // end of transaction (delay/timeout expired, wait condition fulfilled, sending done)