mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2025-11-10 11:47:24 +01:00
Fixes the Tor leaks for relays and some image content.
This commit is contained in:
@@ -132,7 +132,7 @@ class Relay(
|
||||
|
||||
lastConnectTentative = TimeUtils.now()
|
||||
|
||||
socket = socketBuilder.build(url, false, RelayListener(onConnected))
|
||||
socket = socketBuilder.build(url, forceProxy, RelayListener(onConnected))
|
||||
socket?.connect()
|
||||
} catch (e: Exception) {
|
||||
if (e is CancellationException) throw e
|
||||
|
||||
@@ -91,7 +91,8 @@ class RelayPool : Relay.Listener {
|
||||
|
||||
fun loadRelays(relayList: List<Relay>) {
|
||||
check(relayList.isNotEmpty()) { "Relay list should never be empty" }
|
||||
relayList.forEach { addRelay(it) }
|
||||
relayList.forEach { addRelayInner(it) }
|
||||
updateStatus()
|
||||
}
|
||||
|
||||
fun unloadRelays() {
|
||||
@@ -142,9 +143,13 @@ class RelayPool : Relay.Listener {
|
||||
}
|
||||
|
||||
fun addRelay(relay: Relay) {
|
||||
addRelayInner(relay)
|
||||
updateStatus()
|
||||
}
|
||||
|
||||
private fun addRelayInner(relay: Relay) {
|
||||
relay.register(this)
|
||||
relays += relay
|
||||
updateStatus()
|
||||
}
|
||||
|
||||
fun removeRelay(relay: Relay) {
|
||||
|
||||
Reference in New Issue
Block a user