summaryrefslogtreecommitdiff
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
parente23a3bf428ce8e99c55746a2cc267e0a3a5b96d3 (diff)
update ObfsvpnClient to latest obfsvpn api: handle bubbled up errors
-rw-r--r--app/src/main/java/se/leap/bitmaskclient/pluggableTransports/ObfsVpnClient.java22
m---------bitmaskcore0
2 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) {
diff --git a/bitmaskcore b/bitmaskcore
-Subproject 7185b55d5aebb10e2d6b18f990da58aea26c15a
+Subproject f5b935b77204291ded7d7b1304dc6026e699166