From 0fef9e2e19ccc77456a66f4f174b1fea94c1260f Mon Sep 17 00:00:00 2001 From: cyBerta Date: Fri, 3 Jun 2022 18:41:59 +0200 Subject: ensure socks proxy has started before openvpn tries to use it --- .../pluggableTransports/ObfsVpnClient.java | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) (limited to 'app/src') diff --git a/app/src/main/java/se/leap/bitmaskclient/pluggableTransports/ObfsVpnClient.java b/app/src/main/java/se/leap/bitmaskclient/pluggableTransports/ObfsVpnClient.java index c871c708..69210881 100644 --- a/app/src/main/java/se/leap/bitmaskclient/pluggableTransports/ObfsVpnClient.java +++ b/app/src/main/java/se/leap/bitmaskclient/pluggableTransports/ObfsVpnClient.java @@ -27,18 +27,16 @@ public class ObfsVpnClient implements Observer { } public void start() { - new Thread(() -> { - synchronized (LOCK) { - Log.d(TAG, "aquired LOCK"); - new Thread(obfsVpnClient::start).start(); - try { - Thread.sleep(500); - } catch (InterruptedException e) { - e.printStackTrace(); - } - Log.d(TAG, "returning LOCK after 500 ms"); + synchronized (LOCK) { + Log.d(TAG, "aquired LOCK"); + new Thread(obfsVpnClient::start).start(); + try { + Thread.sleep(500); + } catch (InterruptedException e) { + e.printStackTrace(); } - }).start(); + Log.d(TAG, "returning LOCK after 500 ms"); + } } public void stop() { -- cgit v1.2.3