Browse Source

poking at stuff

Stan Gurtler 2 years ago
parent
commit
13beb086fb
1 changed files with 13 additions and 15 deletions
  1. 13 15
      prsona/src/networkOrchestrator.cpp

+ 13 - 15
prsona/src/networkOrchestrator.cpp

@@ -40,46 +40,44 @@ void start_remote_actor(
     argv[0] = fileBuffer;
 
     char flagBuffer[3];
-    strncpy(flagBuffer, "-f", 3);
+    strncpy(flagBuffer, "-n", 3);
 
     char targetBuffer[64];
     strncpy(targetBuffer, target.c_str(), 64);
 
-    std::string fullArgString();
+    std::string fullArgString("~/prsona/prsona/scripts/startup.sh ");
     char fullArgBuffer[256];
 
+    fullArgString = fullArgString + (server ? "server" : "client") + " ";
+
     char idBuffer[64];
     strncpy(idBuffer, id.c_str(), 64);
 
+    fullArgString = fullArgString + id + " ";
+
     char outputBuffer[128];
     strncpy(outputBuffer, output.c_str(), 128);
 
+    fullArgString = fullArgString + output + " ";
+
     std::stringstream lambdaStream;
     lambdaStream << lambda;
     char lambdaBuffer[3];
     strncpy(lambdaBuffer, lambdaStream.str().c_str(), 3);
 
+    fullArgString = fullArgString + lambdaStream.str() + " ";
+
     char maliciousBuffer[3];
     if (maliciousServers)
         strncpy(maliciousBuffer, "T", 2);
     else
         strncpy(maliciousBuffer, "F", 2);
 
+    fullArgString = fullArgString + (maliciousServers ? "T" : "F");
+    strncpy(fullArgBuffer, fullArgString.c_str(), 256);
+
     if (target != "self" && !target.empty())
     {
-        fullArgString = "~/prsona/prsona/scripts/startup.sh ";
-        fullArgString += (server ? "server" : "client");
-        fullArgString += " ";
-        fullArgString += id;
-        fullArgString += " ";
-        fullArgString += output;
-        fullArgString += " ";
-        fullArgString += lambdaStream.str();
-        fullArgString += " ";
-        fullArgString += (maliciousServers ? "T" : "F");
-
-        strncpy(fullArgBuffer, fullArgString.c_str(), 256);
-
         argv[1] = flagBuffer;
         argv[2] = targetBuffer;
         argv[3] = fullArgBuffer;