X-Git-Url: https://git.teslayout.com/public/public/public/?a=blobdiff_plain;f=source%2Fdiameter.comm%2FEngine.cpp;h=867b6cceb093af97502194853a6ae6d7bdd15366;hb=c56124ff93e8bceec159748dfe5ba8d56c62e3de;hp=56aa1b64f0123904d05a2bc810e54e63bf81d805;hpb=d723d5bf571eb48c641b092058eaa38bb6c4fcc8;p=anna.git diff --git a/source/diameter.comm/Engine.cpp b/source/diameter.comm/Engine.cpp index 56aa1b6..867b6cc 100644 --- a/source/diameter.comm/Engine.cpp +++ b/source/diameter.comm/Engine.cpp @@ -125,7 +125,7 @@ void comm::Engine::setClientCERandDWR(const std::string & cer, const std::string if (cer != "") { try { - diameterCER.loadXML(cer); + diameterCER.loadXMLFile(cer); } catch(anna::RuntimeException &ex) { //ex.trace(); encodeDefault = true; @@ -156,7 +156,7 @@ void comm::Engine::setClientCERandDWR(const std::string & cer, const std::string if (dwr != "") { try { - diameterDWR.loadXML(dwr); + diameterDWR.loadXMLFile(dwr); } catch(anna::RuntimeException &ex) { //ex.trace(); encodeDefault = true; @@ -345,15 +345,14 @@ throw(anna::RuntimeException) { // Assignments (it could be done at allocate): if((a_cer.isEmpty()) || (a_dwr.isEmpty())) - throw anna::RuntimeException("Must define valid CER and DWR messages by mean setCERandDWR()", ANNA_FILE_LOCATION); + throw anna::RuntimeException("Must define valid CER and DWR messages by mean setClientCERandDWR()", ANNA_FILE_LOCATION); result->a_cer.setBody(a_cer); result->a_dwr.setBody(a_dwr); result->setWatchdogPeriod(a_watchdogPeriod); result->a_parent = server; result->a_socketId = socketId; - result->initializeSequences(); // despu�s de asignar el server y el socketId (*) - // (*) Las secuencias se basan en la semilla: srand(::time(NULL) + anna::functions::exclusiveHash(anna::functions::asString("%s:%d|%d", getAddress().c_str(), getPort(), a_socketId))); + result->initializeSequences(); // despues de asignar el server y el socketId (sequences are seed-based by mean exclusive hash) result->a_engine = this; clientSession_key key = ClientSession::getKey(server->getAddress(), server->getPort(), socketId); a_clientSessions.insert(clientSession_value_type(key, result)); @@ -919,7 +918,6 @@ comm::Engine::entity_key comm::Engine::getEntityKey(const socket_v &v) const thr } result.erase(result.size() - 1, 1); // remove last space - //return anna::functions::exclusiveHash(result); return result; } @@ -1056,7 +1054,13 @@ bool comm::Engine::refreshAvailabilityForLocalServers() throw() { void comm::Engine::readDPA(anna::DataBlock &dpa, const anna::DataBlock & dpr) throw() { // Check for base protocol codec engine health: - assertBaseProtocolHealth(); + try { + assertBaseProtocolHealth(); + } + catch(anna::RuntimeException &ex) { + ex.trace(); + return; + } // Default DPA implementation: // @@ -1112,7 +1116,7 @@ void comm::Engine::readCEA(anna::DataBlock &cea, const anna::DataBlock &cer) thr anna::diameter::codec::Message diameterCEA(getBaseProtocolCodecEngine()); try { - diameterCEA.loadXML(a_ceaPathfile); + diameterCEA.loadXMLFile(a_ceaPathfile); diameterCEA.setHopByHop(anna::diameter::codec::functions::getHopByHop(cer)); diameterCEA.setEndToEnd(anna::diameter::codec::functions::getEndToEnd(cer)); cea = diameterCEA.code();