X-Git-Url: https://git.teslayout.com/public/public/public/?a=blobdiff_plain;f=source%2Fdiameter.comm%2FMessage.cpp;h=43c4301dbca2cb78a82e7f94d4e7b9bf6e96e983;hb=5a6cba5fde2b2f538a7515f8293cc0a8d9589dfa;hp=b8ae7233949a4fa138dc3ac1a729434f55ea3393;hpb=93366a0bda79e6fd6e7dad6316bfcf8cc82f5731;p=anna.git diff --git a/source/diameter.comm/Message.cpp b/source/diameter.comm/Message.cpp index b8ae723..43c4301 100644 --- a/source/diameter.comm/Message.cpp +++ b/source/diameter.comm/Message.cpp @@ -26,13 +26,13 @@ using namespace anna::diameter::comm; const char* Message::asText(const OnExpiry::_v rc) -throw() { - static const char* text [] = { "Abandon", "Ignore" }; +{ + static const char* text [] = { "Abandon", "Ignore", "Retransmit" }; return text [rc]; } string Message::asString() const -throw() { +{ string result("diameter::comm::Message { "); result += "ClassCode: "; result += ClassCode::asText(a_classCode); @@ -44,7 +44,7 @@ throw() { } anna::xml::Node* Message::asXML(anna::xml::Node* parent) const -throw() { +{ anna::xml::Node* result = parent->createChild("diameter.comm.Message"); result->createAttribute("ClassCode", ClassCode::asText(a_classCode)); result->createAttribute("OnExpiry", asText(a_onExpiry)); @@ -54,14 +54,15 @@ throw() { } //void Message::clear () -// throw () +// //{ // ::clear(); //// a_classCode = ClassCode::Undefined; //// a_onExpiry = OnExpiry::Ignore; //} -bool Message::fixRequestSequence(HopByHop hbh, EndToEnd ete, bool freezeEndToEnd) throw() { + +bool Message::fixRequestSequence(HopByHop hbh, EndToEnd ete) { setRequestHopByHop(getHopByHop()); // original request hop-by-hop (backup) setRequestEndToEnd(getEndToEnd()); // original request end-to-end (backup) bool result = false; @@ -71,7 +72,7 @@ bool Message::fixRequestSequence(HopByHop hbh, EndToEnd ete, bool freezeEndToEnd result = true; } - if(!freezeEndToEnd) { + if(a_endToEndSequenced) { if(ete != getRequestEndToEnd()) { codec::functions::setEndToEnd((anna::DataBlock&)getBody(), ete); result = true; @@ -85,7 +86,7 @@ bool Message::fixRequestSequence(HopByHop hbh, EndToEnd ete, bool freezeEndToEnd msg += " (original) -> "; msg += anna::functions::asString(hbh); msg += " (session)"; - msg += freezeEndToEnd ? " | End to end [freezed]: " : " | End to end: "; + msg += a_endToEndSequenced ? " | End to end: " : " | End to end [end-to-end unchanged]: "; msg += anna::functions::asString(getRequestEndToEnd()); msg += " (original) -> "; msg += anna::functions::asString(ete); @@ -97,7 +98,7 @@ bool Message::fixRequestSequence(HopByHop hbh, EndToEnd ete, bool freezeEndToEnd -void Message::restoreSequencesAfterFix() throw() { +void Message::restoreSequencesAfterFix() { LOGDEBUG( string msg("diameter::comm::restoreSequencesAfterFix { "); msg += "Hop by hop: "; @@ -118,7 +119,7 @@ void Message::restoreSequencesAfterFix() throw() { void Message::send(ClientSession& clientSession) const -throw(anna::RuntimeException) { +noexcept(false) { try { clientSession.getServer()->send((Message *)this); } catch(anna::RuntimeException&) { @@ -127,7 +128,7 @@ throw(anna::RuntimeException) { } void Message::send(ServerSession& serverSession) const -throw(anna::RuntimeException) { +noexcept(false) { try { serverSession.getClientSocket()->send((Message *)this); } catch(anna::RuntimeException&) { @@ -137,16 +138,21 @@ throw(anna::RuntimeException) { -anna::diameter::CommandId Message::getCommandId(bool &isRequest) const throw() { +anna::diameter::CommandId Message::getCommandId(bool &isRequest) const { diameter::CommandId result = diameter::codec::functions::getCommandId(getBody()); isRequest = result.second; // diameter::codec::functions::isRequest(result); return result; } -HopByHop Message::getHopByHop() const throw() { +anna::diameter::ApplicationId Message::getApplicationId() const { + diameter::ApplicationId result = diameter::codec::functions::getApplicationId(getBody()); + return result; +} + +HopByHop Message::getHopByHop() const { return (diameter::codec::functions::getHopByHop(getBody())); } -EndToEnd Message::getEndToEnd() const throw() { +EndToEnd Message::getEndToEnd() const { return (diameter::codec::functions::getEndToEnd(getBody())); }