testing the wrong thing gives wrong test result.

This commit is contained in:
Sarah 2021-10-18 15:46:35 +02:00
parent 31e142131c
commit 6d2dc3280b
No known key found for this signature in database
GPG key ID: 708F7ACE058F0186

View file

@ -136,7 +136,7 @@ class DiscoveryProtocol(asyncio.DatagramProtocol, Store):
logging.warn(f"Remote({addr1}:{addr2})-store path is dead: {sp}")
pass
_, _, hsh, _ = sp.split("/", 2)
_, _, hsh, _ = sp.split("/", 3)
narinfo = await self.narinfo(hsh)
if narinfo is None:
logging.warn(f"All sources are gone.")
@ -145,7 +145,7 @@ class DiscoveryProtocol(asyncio.DatagramProtocol, Store):
return await self._nar_req(narinfo.url)
async def _nar_req(self, url: str) -> t.Awaitable[t.AsyncIterable[bytes]]:
addr1, addr2, _, p = url.split("/", 2)
addr1, addr2, _, p = url.split("/", 3)
resp = await self.session.get(f"http://{addr1}:{addr2}/{p}")
if resp.status == 200:
return self._nar_direct(resp)