From 2aba4dcaaec3038b4b7b66e84f00321f40357cb1 Mon Sep 17 00:00:00 2001 From: Eduardo Ramos Testillano Date: Fri, 11 Jul 2014 18:40:10 +0200 Subject: [PATCH] Bug on xml parsing for U64 types (appid, hop by hop, end to end) --- source/core/internal/ModuleManager.cpp | 2 ++ source/diameter/codec/Message.cpp | 23 ++++++++++++----------- 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/source/core/internal/ModuleManager.cpp b/source/core/internal/ModuleManager.cpp index 787cf27..b2bd74e 100644 --- a/source/core/internal/ModuleManager.cpp +++ b/source/core/internal/ModuleManager.cpp @@ -39,6 +39,8 @@ #include #include +#include + using namespace std; using namespace anna; diff --git a/source/diameter/codec/Message.cpp b/source/diameter/codec/Message.cpp index e28ca64..6490b81 100644 --- a/source/diameter/codec/Message.cpp +++ b/source/diameter/codec/Message.cpp @@ -709,6 +709,7 @@ void Message::fromXML(const anna::xml::Node* messageNode) throw(anna::RuntimeExc hbh = messageNode->getAttribute("hop-by-hop-id", false /* no exception */); ete = messageNode->getAttribute("end-by-end-id", false /* no exception */); int i_aux; + unsigned int u_aux; if(version) { i_aux = version->getIntegerValue(); @@ -808,41 +809,41 @@ void Message::fromXML(const anna::xml::Node* messageNode) throw(anna::RuntimeExc } // Application-id - i_aux = appid->getIntegerValue(); + u_aux = appid->getIntegerValue(); - if(i_aux < 0) { + if(u_aux < 0) { std::string msg = "Error processing command getValue(); msg += "': negative values are not allowed"; throw anna::RuntimeException(msg, ANNA_FILE_LOCATION); } - setApplicationId(i_aux); + setApplicationId(u_aux); // Hob-by-hop-id if(hbh) { - i_aux = hbh->getIntegerValue(); + u_aux = hbh->getIntegerValue(); - if(i_aux < 0) { + if(u_aux < 0) { std::string msg = "Error processing command getValue(); msg += "': negative values are not allowed"; throw anna::RuntimeException(msg, ANNA_FILE_LOCATION); } - } else i_aux = 0; + } else u_aux = 0; - setHopByHop(i_aux); + setHopByHop(u_aux); // End-to-end-id if(ete) { - i_aux = ete->getIntegerValue(); + u_aux = ete->getIntegerValue(); - if(i_aux < 0) { + if(u_aux < 0) { std::string msg = "Error processing command getValue(); msg += "': negative values are not allowed"; throw anna::RuntimeException(msg, ANNA_FILE_LOCATION); } - } else i_aux = 0; + } else u_aux = 0; - setEndToEnd(i_aux); + setEndToEnd(u_aux); // Childrens Avp *avp; -- 2.20.1