Skip to content

Commit

Permalink
added missing chunks and pending chunks to start supporting a packetl…
Browse files Browse the repository at this point in the history
…oss mechanism
  • Loading branch information
shacharz committed Feb 12, 2013
1 parent 8d11286 commit 645a45c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions public/js/sfClient.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,9 @@

requestChunks:function (targetId) {
var chunkIds = [];
for(var i=0;i<this.numOfChunksToAllocate && (Object.keys(this.chunks).length + i)<this.numOfChunksInFile;++i){
chunkIds.push(Object.keys(this.chunks).length + i);
var missingChunksArr = Object.keys(this.missingChunks);
for(var i=0;i<this.numOfChunksToAllocate && i < missingChunksArr.length;++i){
chunkIds.push(missingChunksArr[i]);
}
this.incomingChunks[targetId]+=chunkIds.length;
this.peerConnections[targetId].send(proto64.need(this.clientId, 1, 1, chunkIds))
Expand Down

0 comments on commit 645a45c

Please sign in to comment.