Skip to content

Commit ad87214

Browse files
committed
Fixed an issue when application crashed in proxy mode after a failure
1 parent 3dc3490 commit ad87214

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

app/src/main/java/io/github/krlvm/powertunnel/android/managers/ProxyManager.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,7 @@ public void stop(boolean graceful) {
146146
Log.w(LOG_TAG, "Attempted to stop server when it is not running");
147147
return;
148148
}
149+
if (!this.server.isRunning()) return;
149150

150151
new Thread(() -> {
151152
Log.i(LOG_TAG, "Stopping server...");

app/src/main/java/io/github/krlvm/powertunnel/android/services/ProxyService.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ public int onStartCommand(Intent intent, int flags, int startId) {
7777
.putExtra(PowerTunnelService.EXTRAS_MODE, TunnelMode.PROXY)
7878
.putExtra(PowerTunnelService.EXTRAS_ERROR, error)
7979
);
80+
stopSelf();
8081
},
8182
TunnelingVpnService.getDefaultDNS(this)
8283
);

0 commit comments

Comments
 (0)