Skip to content

Commit

Permalink
Merge branch 'master' into staging-client
Browse files Browse the repository at this point in the history
  • Loading branch information
rod-hynes committed Jul 9, 2019
2 parents 1693611 + 328bcc0 commit 85a38ad
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions MobileLibrary/iOS/PsiphonTunnel/PsiphonTunnel/PsiphonTunnel.m
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,10 @@ - (BOOL)initNoticeFiles {
- (BOOL)startIfNeeded {
PsiphonConnectionState connState = [self getConnectionState];

if (connState == PsiphonConnectionStateDisconnected) {
return [self start];
}

// We have found that on iOS, the local proxies will get killed before the
// tunnel gets disconnected (or before it realizes it's dead). So we need to
// start if we either in a disconnected state or if our local proxies are dead.
Expand All @@ -341,8 +345,7 @@ - (BOOL)startIfNeeded {
needRestart = (httpProxyPort != 0 && ![self isLocalProxyAliveAtPort:httpProxyPort]);
}

if ((connState == PsiphonConnectionStateDisconnected) ||
(connState == PsiphonConnectionStateConnected && needRestart)) {
if (needRestart) {
return [self start];
}

Expand Down

0 comments on commit 85a38ad

Please sign in to comment.