diff --git a/briar-android/libs/jtorctl-briar.jar b/briar-android/libs/jtorctl-briar.jar index e9c8d84e09b0a38572dd2ba3691123a72e80b1b9..a3bd4a68828e317ee79279e334f42b28e76efaff 100644 Binary files a/briar-android/libs/jtorctl-briar.jar and b/briar-android/libs/jtorctl-briar.jar differ diff --git a/briar-android/src/org/briarproject/plugins/tor/TorPlugin.java b/briar-android/src/org/briarproject/plugins/tor/TorPlugin.java index be89d867eec02a61d3f28a9b09d89e5f4c962d65..02d8d9c11efd8399a2aadf0442a98e58dd1efade 100644 --- a/briar-android/src/org/briarproject/plugins/tor/TorPlugin.java +++ b/briar-android/src/org/briarproject/plugins/tor/TorPlugin.java @@ -61,7 +61,7 @@ class TorPlugin implements DuplexPlugin, EventHandler { static final TransportId ID = new TransportId("tor"); private static final String[] EVENTS = { - "CIRC", "STREAM", "ORCONN", "NOTICE", "WARN", "ERR" + "CIRC", "ORCONN", "NOTICE", "WARN", "ERR" }; private static final int SOCKS_PORT = 59050, CONTROL_PORT = 59051; private static final int COOKIE_TIMEOUT = 3000; // Milliseconds @@ -210,6 +210,8 @@ class TorPlugin implements DuplexPlugin, EventHandler { // Open a control connection and authenticate using the cookie file controlConnection = new TorControlConnection(controlSocket); controlConnection.authenticate(read(cookieFile)); + // Tell Tor to exit when the control connection is closed + controlConnection.takeOwnership(); // Register to receive events from the Tor process controlConnection.setEventHandler(this); controlConnection.setEvents(Arrays.asList(EVENTS)); @@ -632,10 +634,14 @@ class TorPlugin implements DuplexPlugin, EventHandler { throw new UnsupportedOperationException(); } - public void circuitStatus(String status, String id, String path) { + public void circuitStatus(String status, String id, String path, + String flags, String purpose, String hsState) { if(LOG.isLoggable(INFO)) { - if(!"EXTENDED".equals(status)) - LOG.info("Circuit " + id + " " + status); + String msg = "Circuit " + id + " " + status; + if(flags.length() > 0) msg += ", flags: " + flags; + if(purpose.length() > 0) msg += ", purpose: " + purpose; + if(hsState.length() > 0) msg += ", state: " + hsState; + LOG.info(msg); } if("BUILT".equals(status) && firstCircuit.getAndSet(false)) { LOG.info("First circuit built"); @@ -643,9 +649,7 @@ class TorPlugin implements DuplexPlugin, EventHandler { } } - public void streamStatus(String status, String id, String target) { - if(LOG.isLoggable(INFO)) LOG.info("Stream " + id + " " + status); - } + public void streamStatus(String status, String id, String target) {} public void orConnStatus(String status, String orName) { if(LOG.isLoggable(INFO)) LOG.info("OR connection " + status); @@ -659,7 +663,9 @@ class TorPlugin implements DuplexPlugin, EventHandler { if(LOG.isLoggable(INFO)) LOG.info(severity + " " + msg); } - public void unrecognized(String type, String msg) {} + public void unrecognized(String type, String msg) { + if(LOG.isLoggable(INFO)) LOG.info(type + " " + msg); + } private static class WriteObserver extends FileObserver {