Suuports clang compiler
[anna.git] / example / diameter / launcher / main.cpp
index 416acce..280624c 100644 (file)
@@ -452,7 +452,7 @@ int Launcher::pushBurst(int loadAmount) throw() {
    }
 
    a_burstActive = true;
-   register int count;
+   int count;
 
    for (count = 0; count < loadAmount; count++)
       if (!sendBurstMessage()) break;
@@ -476,7 +476,7 @@ int Launcher::sendBurst(int loadAmount) throw() {
       return -2;
    }
 
-   register int count;
+   int count;
 
    for (count = 0; count < loadAmount; count++)
       if (!sendBurstMessage(true /* anyway */)) break;
@@ -517,7 +517,7 @@ bool Launcher::sendBurstMessage(bool anyway) throw() {
          if (a_burstRepeat) {
             a_burstCycle++;
 
-            if (burstLogEnabled()) writeBurstLogFile(anna::functions::asString(("\nCompleted burst cycle. Starting again (repeat mode) on cycle %d.\n", a_burstCycle)));
+            if (burstLogEnabled()) writeBurstLogFile(anna::functions::asString("\nCompleted burst cycle. Starting again (repeat mode) on cycle %d.\n", a_burstCycle));
          } else {
             if (burstLogEnabled()) writeBurstLogFile("\nCompleted burst cycle. Burst finished (repeat mode disabled).\n");
 
@@ -757,20 +757,18 @@ std::string Launcher::help() const throw() {
    result += "\nanswerxml|[source_file]    Same as 'answerxml2c'.";
    result += "\n                           List programmed answers if no parameter provided.";
    result += "\n";
-   result += "\nSame operations are available using hexadecimal content (hex formatted files) which also allow to test";
+   result += "\nSend operations are available using hexadecimal content (hex formatted files) which also allow to test";
    result += "\nspecial scenarios (protocol errors):";
    result += "\n";
    result += "\nsendhex2e|<source_file>    Sends hex source file (pathfile) through configured entity.";
    result += "\nsendhex2c|<source_file>    Sends hex source file (pathfile) to client.";
    result += "\nsendhex|<source_file>      Same as 'sendhex2e'.";
-   result += "\nanswerhex2e|[source_file]  Answer hex source file (pathfile) for corresponding request from entity.";
-   result += "\nanswerhex2c|[source_file]  Answer hex source file (pathfile) for corresponding request from client.";
-   result += "\nanswerhex|[source_file]    Same as 'answerhex2c'.";
-   result += "\n                           List programmed answers if no parameter provided.";
-   result += "\n";
    result += "\n";
+   result += "\nAnswer programming in hexadecimal is not really neccessary (you could use send primitives) and also";
+   result += "\nis intended to be used with decoded messages in order to replace things like hop by hop, end to end,";
+   result += "\nsubscriber id, session id, etc.";
    result += "\n";
-   result += "\nIf a request is received, answer map (built with 'answerxml/hex<[2c] or 2e>' operations) will be";
+   result += "\nIf a request is received, answer map (built with 'answerxml<[2c] or 2e>' operations) will be";
    result += "\n checked to find a corresponding programmed answer to be replied(*). If no ocurrence is found,";
    result += "\n or answer message was received, the message is forwarded to the other side (entity or client),";
    result += "\n or nothing but trace when no peer at that side is configured. Answer to client have sense when";
@@ -1748,7 +1746,7 @@ void Launcher::eventOperation(const std::string &operation, std::string &respons
    } else if (opType == "decode") {
       // Get DataBlock from file with hex content:
       if (!getDataBlockFromHexFile(param1, db_aux))
-         throw anna::RuntimeException("Cannot interpret hexadecimal content from file provided", ANNA_FILE_LOCATION);
+         throw anna::RuntimeException("Error reading hex file provided", ANNA_FILE_LOCATION);
 
       // Decode
       try { G_codecMsg.decode(db_aux); } catch (anna::RuntimeException &ex) { ex.trace(); }
@@ -1802,7 +1800,7 @@ void Launcher::eventOperation(const std::string &operation, std::string &respons
       else {
         // Get DataBlock from file with hex content:
         if (!getDataBlockFromHexFile(param1, db_aux))
-          throw anna::RuntimeException("Cannot interpret hexadecimal content from file provided", ANNA_FILE_LOCATION);
+          throw anna::RuntimeException("Error reading hex file provided", ANNA_FILE_LOCATION);
         G_commMsgSent2e.setBody(db_aux);
       }
 
@@ -1919,7 +1917,7 @@ void Launcher::eventOperation(const std::string &operation, std::string &respons
          throw anna::RuntimeException("Wrong body content format on HTTP Request for 'burst' operation (unexpected action parameter). See help", ANNA_FILE_LOCATION);
       }
 
-   } else if ((opType == "sendxml2c")||(opType == "sendhex2c")) {
+   } else if ((opType == "sendxml2c") || (opType == "sendhex2c")) {
       anna::diameter::comm::LocalServer *localServer = getDiameterLocalServer();
       if (!localServer) throw anna::RuntimeException("No local server configured to send the message", ANNA_FILE_LOCATION);
 
@@ -1932,7 +1930,7 @@ void Launcher::eventOperation(const std::string &operation, std::string &respons
       else {
         // Get DataBlock from file with hex content:
         if (!getDataBlockFromHexFile(param1, db_aux))
-          throw anna::RuntimeException("Cannot interpret hexadecimal content from file provided", ANNA_FILE_LOCATION);
+          throw anna::RuntimeException("Error reading hex file provided", ANNA_FILE_LOCATION);
         G_commMsgSent2c.setBody(db_aux);
       }
 
@@ -1989,7 +1987,7 @@ void Launcher::eventOperation(const std::string &operation, std::string &respons
          response_content = "Programmed answers dumped on stdout\n";
          return;
       }
-   } else if ((opType == "answerxml2e")) {
+   } else if (opType == "answerxml2e") {
       anna::diameter::comm::Entity *entity = getEntity();
 
       if (!entity)
@@ -2079,7 +2077,7 @@ void Launcher::eventOperation(const std::string &operation, std::string &respons
       response_content += param1;
       response_content += "' programmed.";
       response_content += "\n";
-   } else if ((opType == "answerxml2e")) {
+   } else if (opType == "answerxml2e") {
       response_content += "Answer to entity '";
       response_content += param1;
       response_content += "' programmed.";