summaryrefslogtreecommitdiff
path: root/app/src/main
diff options
context:
space:
mode:
authorcyBerta <cyberta@riseup.net>2022-06-26 19:19:31 +0200
committercyBerta <cyberta@riseup.net>2022-07-19 00:03:56 +0200
commitbfa89faf60d1c88250745f617ff38b13e2a7e34d (patch)
treef4b87593036acdcd0db300d53b89c1f3337ba762 /app/src/main
parente23a3bf428ce8e99c55746a2cc267e0a3a5b96d3 (diff)
update ObfsvpnClient to latest obfsvpn api: handle bubbled up errors
Diffstat (limited to 'app/src/main')
-rw-r--r--app/src/main/java/se/leap/bitmaskclient/pluggableTransports/ObfsVpnClient.java22
1 files changed, 20 insertions, 2 deletions
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 69210881..632dc878 100644
--- a/app/src/main/java/se/leap/bitmaskclient/pluggableTransports/ObfsVpnClient.java
+++ b/app/src/main/java/se/leap/bitmaskclient/pluggableTransports/ObfsVpnClient.java
@@ -29,7 +29,14 @@ public class ObfsVpnClient implements Observer {
public void start() {
synchronized (LOCK) {
Log.d(TAG, "aquired LOCK");
- new Thread(obfsVpnClient::start).start();
+ new Thread(() -> {
+ try {
+ obfsVpnClient.start();
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }).start();
+
try {
Thread.sleep(500);
} catch (InterruptedException e) {
@@ -42,10 +49,21 @@ public class ObfsVpnClient implements Observer {
public void stop() {
synchronized (LOCK) {
Log.d(TAG, "stopping obfsVpnClient...");
- obfsVpnClient.stop();
+ try {
+ obfsVpnClient.stop();
+ Thread.sleep(500);
+ } catch (Exception e) {
+ e.printStackTrace();
+ VpnStatus.logError("[obfsvpn] " + e.getLocalizedMessage());
+ }
+ Log.d(TAG, "stopping obfsVpnClient releasing LOCK ...");
}
}
+ public boolean isStarted() {
+ return obfsVpnClient.isStarted();
+ }
+
@Override
public void update(Observable observable, Object arg) {
if (observable instanceof EipStatus) {