From 5b19c2273fcdbf19d6ec27f19c64fe46dd5561b9 Mon Sep 17 00:00:00 2001 From: Janos Guljas Date: Fri, 2 Feb 2018 10:49:08 +0100 Subject: [PATCH] swarm/network/stream: add Client.Close() (#229) --- swarm/network/stream/stream.go | 2 ++ swarm/network/stream/syncer.go | 2 ++ 2 files changed, 4 insertions(+) diff --git a/swarm/network/stream/stream.go b/swarm/network/stream/stream.go index ea19d28f05..5770f679c3 100644 --- a/swarm/network/stream/stream.go +++ b/swarm/network/stream/stream.go @@ -298,6 +298,7 @@ type client struct { type Client interface { NeedData([]byte) func() BatchDone(string, uint64, []byte, []byte) func() (*TakeoverProof, error) + Close() } // nextBatch adjusts the indexes by inspecting the intervals @@ -344,6 +345,7 @@ func (c *client) batchDone(p *Peer, req *OfferedHashesMsg, hashes []byte) error func (c *client) close() { close(c.next) + c.Close() } // Spec is the spec of the streamer protocol diff --git a/swarm/network/stream/syncer.go b/swarm/network/stream/syncer.go index 2369a2ae5f..6d8473afc9 100644 --- a/swarm/network/stream/syncer.go +++ b/swarm/network/stream/syncer.go @@ -253,3 +253,5 @@ func (s *SwarmSyncerClient) TakeoverProof(streamName string, from uint64, hashes Sig: nil, }, nil } + +func (s *SwarmSyncerClient) Close() {}