mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2025-01-31 08:25:35 +00:00
Support comma-separated multi-location hints.
This commit is contained in:
parent
8b3280bf31
commit
71b7e9b643
@ -14,6 +14,8 @@ the configuration process.
|
|||||||
|
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
|
from itertools import chain
|
||||||
|
|
||||||
from twisted.internet.protocol import Protocol
|
from twisted.internet.protocol import Protocol
|
||||||
from twisted.internet.interfaces import IDelayedCall
|
from twisted.internet.interfaces import IDelayedCall
|
||||||
from twisted.internet.ssl import CertificateOptions
|
from twisted.internet.ssl import CertificateOptions
|
||||||
@ -94,7 +96,11 @@ class _FoolscapOrHttps(Protocol, metaclass=_PretendToBeNegotiation):
|
|||||||
)
|
)
|
||||||
|
|
||||||
storage_nurls = set()
|
storage_nurls = set()
|
||||||
for location_hint in cls.tub.locationHints:
|
# Individual hints can be in the form
|
||||||
|
# "tcp:host:port,tcp:host:port,tcp:host:port".
|
||||||
|
for location_hint in chain.from_iterable(
|
||||||
|
hints.split(",") for hints in cls.tub.locationHints
|
||||||
|
):
|
||||||
if location_hint.startswith("tcp:"):
|
if location_hint.startswith("tcp:"):
|
||||||
_, hostname, port = location_hint.split(":")
|
_, hostname, port = location_hint.split(":")
|
||||||
port = int(port)
|
port = int(port)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user