|
|
@@ -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{},
|
|
|
},
|
|
|
}
|
|
|
|