Added ID forwarding.

This commit is contained in:
Tristan B. Kildaire 2020-05-14 11:22:41 +02:00
parent be2953595d
commit 95577698b8
3 changed files with 7 additions and 7 deletions

View File

@ -1,6 +1,6 @@
{
"network" : {
"types" : ["unix", "tcp4", "tcp6"],
"types" : ["tcp4", "tcp6"],
"unix" : {
"address" : "besterUNIXSock"
},

View File

@ -265,8 +265,8 @@ public final class BesterConnection : Thread
/* TODO: Continue here, we will make all error handling do on construction as to make this all more compact */
debugPrint("<<< Message Handler [" ~ chosenHandler.getPluginName() ~ "] response >>>\n\n" ~ handlerResponse.toString());
/* Execute the message handler's command (as per its reply) */
handlerResponse.execute(this);
/* Execute the message handler's command (as per its reply) and pass in the tag */
handlerResponse.execute(this, payloadTag);
}
catch(ResponseError e)
{

View File

@ -155,7 +155,7 @@ public final class HandlerResponse
* Executes the command. Either `sendClients`, `sendServers`
* or `sendHandler`.
*/
public void execute(BesterConnection originalRequester)
public void execute(BesterConnection originalRequester, string messageID)
{
/* TODO: Implement me */
@ -231,7 +231,7 @@ public final class HandlerResponse
/**
* Send a status report here.
*/
originalRequester.sendStatusReport(cast(BesterConnection.StatusType)!allSuccess, messageResponse["payload"]["id"].str());
originalRequester.sendStatusReport(cast(BesterConnection.StatusType)!allSuccess, messageID);
}
else if (commandType == CommandType.SEND_SERVERS)
{
@ -302,7 +302,7 @@ public final class HandlerResponse
/**
* Send a status report here.
*/
originalRequester.sendStatusReport(cast(BesterConnection.StatusType)!allSuccess, messageResponse["payload"]["id"].str());
originalRequester.sendStatusReport(cast(BesterConnection.StatusType)!allSuccess, messageID);
}
else if (commandType == CommandType.SEND_HANDLER)
{
@ -317,7 +317,7 @@ public final class HandlerResponse
HandlerResponse handlerResponse = chosenHandler.handleMessage(messageResponse["data"]);
/* Execute the code (this here, recursive) */
handlerResponse.execute(originalRequester);
handlerResponse.execute(originalRequester, messageID);
debugPrint("SEND_HANDLER: Completed run");
}