summaryrefslogtreecommitdiff
path: root/app/java/src/DNSProxyConnection.java
diff options
context:
space:
mode:
authorDaniel Weipert <code@drogueronin.de>2023-05-12 13:12:57 +0200
committerDaniel Weipert <code@drogueronin.de>2023-05-12 13:12:57 +0200
commit7f0436aa2a782d926a81bd5bdf76baf0253582da (patch)
tree2f6e86364060ff8ee11a948febbac6a3f451f4e3 /app/java/src/DNSProxyConnection.java
parenteefe2bdea6e79548ef5a0c0a50b3afc495b034b3 (diff)
working commit
Diffstat (limited to 'app/java/src/DNSProxyConnection.java')
-rw-r--r--app/java/src/DNSProxyConnection.java12
1 files changed, 5 insertions, 7 deletions
diff --git a/app/java/src/DNSProxyConnection.java b/app/java/src/DNSProxyConnection.java
index f96af80..0573515 100644
--- a/app/java/src/DNSProxyConnection.java
+++ b/app/java/src/DNSProxyConnection.java
@@ -4,8 +4,6 @@ import android.os.ParcelFileDescriptor;
import android.util.Log;
-import java.io.IOException;
-
public class DNSProxyConnection {
public static String THREAD_NAME = "org.pihole.dnsproxy.service.thread";
@@ -20,8 +18,8 @@ public class DNSProxyConnection {
public void start() {
DNSProxyRunner runner = new DNSProxyRunner(this.service);
- runner.setOnEstablishListener(parcelFileDescriptor -> {
- this.networkInterface = parcelFileDescriptor;
+ runner.setOnEstablishListener(tunInterface -> {
+ this.networkInterface = tunInterface;
});
this.thread = new Thread(runner, DNSProxyConnection.THREAD_NAME);
@@ -30,10 +28,10 @@ public class DNSProxyConnection {
public void stop() {
try {
- this.thread.stop();
+ this.thread.interrupt();
this.networkInterface.close();
- } catch (IOException exception) {
- Log.e(DNSProxyService.LOG_TAG, "Connection failed", exception);
+ } catch (Exception exception) {
+ Log.e(DNSProxyService.LOG_TAG, "Closing VPN interface", exception);
}
}
}