mirror of
https://github.com/sot-tech/mochi.git
synced 2026-07-23 16:28:11 -07:00
(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:
+1
-1
@@ -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)
|
||||
|
||||
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user