File Sharing MVP #384

Merged
sarah merged 52 commits from filesharing into master 2021-09-30 00:57:14 +00:00
1 changed files with 3 additions and 1 deletions
Showing only changes of commit b2bb520fea - Show all commits

View File

@ -79,6 +79,7 @@ func (fsss *FileSharingSubSystem) RequestManifestParts(fileKey string) []model.P
manifest := manifestI.(*Manifest)
serializedManifest := manifest.Serialize()
log.Debugf("found serialized manifest: %s", serializedManifest)
chunkID := 0;
for i := 0; i < len(serializedManifest); i += DefaultChunkSize {
offset := i
end := (i + 1) + DefaultChunkSize
@ -90,9 +91,10 @@ func (fsss *FileSharingSubSystem) RequestManifestParts(fileKey string) []model.P
// request this manifest part
messages = append(messages, model.PeerMessage{
Context: event.ContextSendManifest,
ID: fmt.Sprintf("%s.%d", fileKey, uint64(i)),
ID: fmt.Sprintf("%s.%d", fileKey, chunkID),
Data: chunk,
})
chunkID+=1
}
}
return messages