From c7dd2c0d733b44e1b5e8064049116a44c73d6405 Mon Sep 17 00:00:00 2001 From: Alva Swanson Date: Wed, 22 May 2024 16:53:20 +0000 Subject: [PATCH] WhonixTorController: Implement SETCONF command --- .../java/bisq/tor/controller/WhonixTorController.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/network/tor/tor/src/main/java/bisq/tor/controller/WhonixTorController.java b/network/tor/tor/src/main/java/bisq/tor/controller/WhonixTorController.java index dbdde8447b..821a915c47 100644 --- a/network/tor/tor/src/main/java/bisq/tor/controller/WhonixTorController.java +++ b/network/tor/tor/src/main/java/bisq/tor/controller/WhonixTorController.java @@ -62,6 +62,15 @@ public void resetConf(String configName) throws IOException { } } + public void setConfig(String configName, String configValue) throws IOException { + String command = "SETCONF " + configName + "=" + configValue + "\r\n"; + sendCommand(command); + String reply = receiveReply(); + if (!reply.equals("250 OK")) { + throw new ControlCommandFailedException("Couldn't set config: " + configName + "=" + configValue); + } + } + public void setEvents(List events) throws IOException { var stringBuilder = new StringBuffer("SETEVENTS"); events.forEach(event -> stringBuilder.append(" ").append(event));