]> Sergey Matveev's repositories - btrtrc.git/blobdiff - webseed-peer.go
Support banning webseeds
[btrtrc.git] / webseed-peer.go
index 9b1cba2233ec82f05d09a94b4a5177d3d592b138..0cdf4cacd4950300d27b2c4625fc92d10229f712 100644 (file)
@@ -114,10 +114,13 @@ func (ws *webseedPeer) connectionFlags() string {
        return "WS"
 }
 
-// TODO: This is called when banning peers. Perhaps we want to be able to ban webseeds too. We could
-// return bool if this is even possible, and if it isn't, skip to the next drop candidate.
+// Maybe this should drop all existing connections, or something like that.
 func (ws *webseedPeer) drop() {}
 
+func (cn *webseedPeer) ban() {
+       cn.peer.close()
+}
+
 func (ws *webseedPeer) handleUpdateRequests() {
        // Because this is synchronous, webseed peers seem to get first dibs on newly prioritized
        // pieces.