(tested) fix redis to pass tests

* delete info hash count key from redis (replaced with SCARD on infohash set)
* add GC test
* add peer.Addr() functio to always return unwrapped address if 4to6 appear
This commit is contained in:
Lawrence, Rendall
2022-04-15 01:29:57 +03:00
parent 5c2471ca9b
commit 397e106396
17 changed files with 287 additions and 261 deletions
+1 -1
View File
@@ -125,7 +125,7 @@ func (h *responseHook) appendPeers(req *bittorrent.AnnounceRequest, resp *bittor
}
switch addr := req.Peer.Addr(); {
case addr.Is4(), addr.Is4In6():
case addr.Is4():
resp.IPv4Peers = mergePeers(resp.IPv4Peers, peers, max)
case addr.Is6():
resp.IPv6Peers = mergePeers(resp.IPv6Peers, peers, max)
+1 -1
View File
@@ -95,7 +95,7 @@ func NewHook(cfg Config) (middleware.Hook, error) {
log.Debug("performing initial fetch of JWKs")
if err := h.updateKeys(); err != nil {
return nil, errors.New("failed to fetch initial JWK Set: " + err.Error())
return nil, fmt.Errorf("failed to fetch initial JWK Set: %w", err)
}
go func() {