mirror of
https://github.com/sot-tech/mochi.git
synced 2026-07-29 18:48:11 -07:00
remove config package
This commit is contained in:
@@ -6,7 +6,6 @@ package ip
|
||||
|
||||
import (
|
||||
"github.com/chihaya/chihaya"
|
||||
"github.com/chihaya/chihaya/config"
|
||||
"github.com/chihaya/chihaya/server/store"
|
||||
"github.com/chihaya/chihaya/tracker"
|
||||
)
|
||||
@@ -22,7 +21,7 @@ var ErrBlockedClient = tracker.ClientError("disallowed client")
|
||||
// blacklistAnnounceClient provides a middleware that only allows Clients to
|
||||
// announce that are not stored in a ClientStore.
|
||||
func blacklistAnnounceClient(next tracker.AnnounceHandler) tracker.AnnounceHandler {
|
||||
return func(cfg *config.TrackerConfig, req *chihaya.AnnounceRequest, resp *chihaya.AnnounceResponse) error {
|
||||
return func(cfg *chihaya.TrackerConfig, req *chihaya.AnnounceRequest, resp *chihaya.AnnounceResponse) error {
|
||||
blacklisted, err := store.MustGetStore().FindClient(req.PeerID)
|
||||
|
||||
if err != nil {
|
||||
|
||||
@@ -6,7 +6,6 @@ package ip
|
||||
|
||||
import (
|
||||
"github.com/chihaya/chihaya"
|
||||
"github.com/chihaya/chihaya/config"
|
||||
"github.com/chihaya/chihaya/server/store"
|
||||
"github.com/chihaya/chihaya/tracker"
|
||||
)
|
||||
@@ -18,7 +17,7 @@ func init() {
|
||||
// whitelistAnnounceClient provides a middleware that only allows Clients to
|
||||
// announce that are stored in a ClientStore.
|
||||
func whitelistAnnounceClient(next tracker.AnnounceHandler) tracker.AnnounceHandler {
|
||||
return func(cfg *config.TrackerConfig, req *chihaya.AnnounceRequest, resp *chihaya.AnnounceResponse) error {
|
||||
return func(cfg *chihaya.TrackerConfig, req *chihaya.AnnounceRequest, resp *chihaya.AnnounceResponse) error {
|
||||
whitelisted, err := store.MustGetStore().FindClient(req.PeerID)
|
||||
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user