Skip to content

Commit 9aebf28

Browse files
committed
Don’t allow reachability for P2P / loopback
P2P may not need it, and loopback doesn’t make sense on iOS
1 parent 6ce8317 commit 9aebf28

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

src/Couchbase.Lite.Shared/API/Sync/Replicator.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -484,9 +484,14 @@ private void StartReachabilityObserver()
484484
return;
485485
}
486486

487+
var remoteUrl = (Config.Target as URLEndpoint)?.Url;
488+
if(remoteUrl == null) {
489+
return;
490+
}
491+
487492
_reachability = Service.GetInstance<IReachability>() ?? new Reachability();
488493
_reachability.StatusChanged += ReachabilityChanged;
489-
_reachability.Url = Config.RemoteUrl;
494+
_reachability.Url = remoteUrl;
490495
_reachability.Start();
491496
}
492497

src/Couchbase.Lite.Support.Apple/iOS/Support/iOSReachability.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ public void Start()
104104
{
105105
_queue.DispatchSync(() =>
106106
{
107-
if (_started) {
107+
if (_started || Url?.IsLoopback == true) {
108108
return;
109109
}
110110

0 commit comments

Comments
 (0)