Remove warnings
[anna.git] / source / diameter.comm / ServerSession.cpp
index a615c78..e47170a 100644 (file)
@@ -55,7 +55,7 @@ const anna::Millisecond ServerSession::DefaultAllowedInactivityTime(90000); // I
 ServerSession::ServerSession() : Session("diameter::comm::ServerSession", "Diameter Inactivity Detection Timer"),
   a_receiverFactory(this),
   a_cer(ClassCode::Bind),
-  a_dwr(ClassCode::ApplicationMessage) // realmente no es necesario, los Message son por defecto de aplicacion
+  a_dwr(ClassCode::ApplicationMessage) // not actually needed; Message is application type by default
 { initialize(); }
 
 void ServerSession::initialize() throw() {
@@ -81,7 +81,6 @@ int ServerSession::getPort() const throw() {
   return a_parent->getKey().second;
 }
 
-
 const Response* ServerSession::send(const Message* message) throw(anna::RuntimeException) {
   LOGMETHOD(anna::TraceMethod traceMethod(a_className, "send", ANNA_FILE_LOCATION));
 
@@ -314,6 +313,12 @@ void ServerSession::eventPeerShutdown() throw() {
 }
 
 void ServerSession::eventRequestRetransmission(Message *request) throw() {
+
+  // OAM
+  OamModule &oamModule = OamModule::instantiate();
+  oamModule.count(OamModule::Counter::RequestRetransmitted);
+  oamModule.count(OamModule::Counter::RequestRetransmittedOnServerSession);
+
   // Inform father server:
   a_parent->eventRequestRetransmission(this, request);
 }
@@ -373,7 +378,7 @@ throw(anna::RuntimeException) {
   oamModule.count(isRequest ? OamModule::Counter::RequestReceived : OamModule::Counter::AnswerReceived);
   oamModule.count(isRequest ? OamModule::Counter::RequestReceivedOnServerSession : OamModule::Counter::AnswerReceivedOnServerSession);
   // Statistic (size)
-  a_parent->updateReceivedMessageSizeStatisticConcept(message.getSize()); // only on reception (application could manage sent sizes)
+  a_parent->updateReceivedMessageSizeStatisticConcept(message.getSize(), cid); // only on reception (application could manage sent sizes)
 
   if(isRequest) {
     // Si recibo un request, el message solo tiene fiable el DataBlock. Como por defecto se construye como ApplicationMessage,
@@ -392,6 +397,9 @@ throw(anna::RuntimeException) {
       }
 
       a_cer.setBody(db);
+      // Basic DRA:
+      getParent()->getEngine()->manageDrDhServerSession(this, true /* register */);
+
       sendCEA();
       //activateTimer(); // Ya se invoca al inicio de este metodo ::receive
       //bool changes = a_parent->refreshAvailability();
@@ -495,14 +503,14 @@ throw(anna::RuntimeException) {
   anna::Millisecond current = (anna::Millisecond)anna::functions::millisecond();
   anna::Millisecond request = response->getRequest()->getRequestTimestampMs();
   anna::Millisecond timeToAnswerMs = current - request;
-  a_parent->updateProcessingTimeStatisticConcept(timeToAnswerMs);
-  LOGDEBUG
-  (
-    std::string msg = "This diameter request context lasted ";
-    msg += anna::functions::asString(timeToAnswerMs);
-    msg += " milliseconds at diameter client (included network time)";
-    anna::Logger::debug(msg, ANNA_FILE_LOCATION);
-  );
+  a_parent->updateProcessingTimeStatisticConcept(timeToAnswerMs, cid);
+  //LOGDEBUG
+  //(
+  //  std::string msg = "This diameter request context lasted ";
+  //  msg += anna::functions::asString(timeToAnswerMs);
+  //  msg += " milliseconds at diameter client (included network time)";
+  //  anna::Logger::debug(msg, ANNA_FILE_LOCATION);
+  //);
   // Progress origin for tracking purposes on asyncronous boxes with both diameter interfaces (entities and clients)
   Message * requestMessage = const_cast<Message*>(response->getRequest());
   requestMessage->setRequestClientSessionKey(response->getRequest()->getRequestClientSessionKey()); // "" means unkown/unset
@@ -559,7 +567,7 @@ void ServerSession::finalize() throw() {
   }
 
   // Inform father local server (availability changes):
-  bool changes = getParent()->refreshAvailability();
+  getParent()->refreshAvailability();
   // OAM
   bool multipleConnections = (getParent()->getMaxConnections() > 1);
   std::string socket = anna::functions::socketLiteralAsString(getAddress(), getPort());