Partially fixed a bug in the test suite that led to test runs randomly failing.
[invirt/third/libt4.git] / rsm_client.cc
index bff32c2..310d1ad 100644 (file)
@@ -1,14 +1,10 @@
+#include "types.h"
 #include "rsm_client.h"
-#include <vector>
 #include <arpa/inet.h>
-#include <stdio.h>
 #include <handle.h>
 #include <unistd.h>
-#include "lang/verify.h"
-#include "lock.h"
-#include "threaded_log.h"
 
-rsm_client::rsm_client(std::string dst) : primary(dst) {
+rsm_client::rsm_client(string dst) : primary(dst) {
     LOG("create rsm_client");
     lock ml(rsm_client_mutex);
     VERIFY (init_members(ml));
@@ -20,10 +16,10 @@ void rsm_client::primary_failure(lock &) {
     known_mems.pop_back();
 }
 
-rsm_protocol::status rsm_client::invoke(unsigned int proc, std::string &rep, const std::string &req) {
+rsm_protocol::status rsm_client::invoke(unsigned int proc, string &rep, const string &req) {
     lock ml(rsm_client_mutex);
     while (1) {
-        LOG("rsm_client::invoke proc " << std::hex << proc << " primary " << primary);
+        LOG("rsm_client::invoke proc " << hex << proc << " primary " << primary);
         handle h(primary);
 
         ml.unlock();
@@ -36,7 +32,7 @@ rsm_protocol::status rsm_client::invoke(unsigned int proc, std::string &rep, con
         if (!cl)
             goto prim_fail;
 
-        LOG("rsm_client::invoke proc " << std::hex << proc << " primary " << primary << " ret " << std::dec << ret);
+        LOG("rsm_client::invoke proc " << hex << proc << " primary " << primary << " ret " << dec << ret);
         if (ret == rsm_client_protocol::OK)
             return rsm_protocol::OK;
         if (ret == rsm_client_protocol::BUSY) {
@@ -50,7 +46,7 @@ rsm_protocol::status rsm_client::invoke(unsigned int proc, std::string &rep, con
                 continue;
         }
 prim_fail:
-        LOG("primary " << primary << " failed ret " << std::dec << ret);
+        LOG("primary " << primary << " failed ret " << dec << ret);
         primary_failure(ml);
         LOG("rsm_client::invoke: retry new primary " << primary);
     }