aboutsummaryrefslogtreecommitdiffstats
path: root/swarm/network/stream/stream.go
diff options
context:
space:
mode:
Diffstat (limited to 'swarm/network/stream/stream.go')
-rw-r--r--swarm/network/stream/stream.go14
1 files changed, 10 insertions, 4 deletions
diff --git a/swarm/network/stream/stream.go b/swarm/network/stream/stream.go
index 9d0e6c68b..0ac374def 100644
--- a/swarm/network/stream/stream.go
+++ b/swarm/network/stream/stream.go
@@ -489,8 +489,13 @@ func (p *Peer) HandleMsg(ctx context.Context, msg interface{}) error {
case *WantedHashesMsg:
return p.handleWantedHashesMsg(ctx, msg)
- case *ChunkDeliveryMsg:
- return p.streamer.delivery.handleChunkDeliveryMsg(ctx, p, msg)
+ case *ChunkDeliveryMsgRetrieval:
+ //handling chunk delivery is the same for retrieval and syncing, so let's cast the msg
+ return p.streamer.delivery.handleChunkDeliveryMsg(ctx, p, ((*ChunkDeliveryMsg)(msg)))
+
+ case *ChunkDeliveryMsgSyncing:
+ //handling chunk delivery is the same for retrieval and syncing, so let's cast the msg
+ return p.streamer.delivery.handleChunkDeliveryMsg(ctx, p, ((*ChunkDeliveryMsg)(msg)))
case *RetrieveRequestMsg:
return p.streamer.delivery.handleRetrieveRequestMsg(ctx, p, msg)
@@ -681,7 +686,7 @@ func (c *clientParams) clientCreated() {
// Spec is the spec of the streamer protocol
var Spec = &protocols.Spec{
Name: "stream",
- Version: 7,
+ Version: 8,
MaxMsgSize: 10 * 1024 * 1024,
Messages: []interface{}{
UnsubscribeMsg{},
@@ -690,10 +695,11 @@ var Spec = &protocols.Spec{
TakeoverProofMsg{},
SubscribeMsg{},
RetrieveRequestMsg{},
- ChunkDeliveryMsg{},
+ ChunkDeliveryMsgRetrieval{},
SubscribeErrorMsg{},
RequestSubscriptionMsg{},
QuitMsg{},
+ ChunkDeliveryMsgSyncing{},
},
}