Skip to content
Snippets Groups Projects
Commit e5620f8b authored by akwizgran's avatar akwizgran
Browse files

Parts of our jtorctl patch have been merged upstream.

parent 4e028e21
No related branches found
No related tags found
No related merge requests found
No preview for this file type
...@@ -21,7 +21,6 @@ import java.net.Socket; ...@@ -21,7 +21,6 @@ import java.net.Socket;
import java.util.Arrays; import java.util.Arrays;
import java.util.Collection; import java.util.Collection;
import java.util.List; import java.util.List;
import java.util.Map;
import java.util.Scanner; import java.util.Scanner;
import java.util.concurrent.CountDownLatch; import java.util.concurrent.CountDownLatch;
import java.util.concurrent.Executor; import java.util.concurrent.Executor;
...@@ -546,34 +545,14 @@ class TorPlugin implements DuplexPlugin, EventHandler { ...@@ -546,34 +545,14 @@ class TorPlugin implements DuplexPlugin, EventHandler {
throw new UnsupportedOperationException(); throw new UnsupportedOperationException();
} }
public void circuitStatus(String status, String id, List<String> path, public void circuitStatus(String status, String id, String path) {
Map<String, String> info) { if(LOG.isLoggable(INFO)) LOG.info("Circuit " + id + " " + status);
if(LOG.isLoggable(INFO)) {
String msg = "Circuit " + id + " " + status;
String purpose = info.get("PURPOSE");
if(purpose != null) msg += ", purpose: " + purpose;
String hsState = info.get("HS_STATE");
if(hsState != null) msg += ", state: " + hsState;
String rendQuery = info.get("REND_QUERY");
if(rendQuery != null) msg += ", service: " + rendQuery;
if(!path.isEmpty()) msg += ", path: " + shortenPath(path);
LOG.info(msg);
}
if(status.equals("BUILT") && !circuitBuilt.getAndSet(true)) { if(status.equals("BUILT") && !circuitBuilt.getAndSet(true)) {
LOG.info("First circuit built"); LOG.info("First circuit built");
if(isRunning()) callback.pollNow(); if(isRunning()) callback.pollNow();
} }
} }
private String shortenPath(List<String> path) {
StringBuilder s = new StringBuilder();
for(String id : path) {
if(s.length() > 0) s.append(',');
s.append(id.substring(1, 7));
}
return s.toString();
}
public void streamStatus(String status, String id, String target) {} public void streamStatus(String status, String id, String target) {}
public void orConnStatus(String status, String orName) { public void orConnStatus(String status, String orName) {
......
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment