-void ProgrammedAnswers::nextMessage(int code) throw() { //pops the deque and release the message (when deque is not empty: deque::empty)
- reacting_answers_const_iterator it = a_deques.find(code);
- if (it != a_deques.end()) {
- if (!it->second->empty()) {
- if (a_rotate) {
- addMessage(code, *(it->second->begin()));
- }
- else {
- a_codecEngine->releaseMessage(*(it->second->begin()));
- }
- it->second->pop_front();
- }
+void ProgrammedAnswers::nextMessage(int code) throw () { //pops the deque and release the message (when deque is not empty: deque::empty)
+ anna::diameter::codec::Engine *engine;
+
+ try {
+ reacting_answers_const_iterator it = a_deques.find(code);
+ if (it != a_deques.end()) {
+ if (!it->second->empty()) {
+ anna::diameter::codec::Message *message = *(it->second->begin());
+ if (a_rotate) {
+ addMessage(code, message);
+ } else {
+ engine = anna::diameter::codec::EngineManager::instantiate().getCodecEngine(message->getApplicationId());
+ if (engine) {
+ engine->releaseMessage(message);
+ }
+ else {
+ LOGWARNING(anna::Logger::warning("Cannot release a message for which i don't know the codec engine (check the registered stack id regarding the message application id) !", ANNA_FILE_LOCATION));
+ return;
+ }
+ }
+ it->second->pop_front();
+ }
+ }
+ }
+ catch (anna::RuntimeException &ex) {
+ ex.trace();