mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-17 13:30:36 -04:00
- Added a ChunkMap class responsible for allocating new chunks to be downloaded, according to
- a given chunk strategy - the availablility map of each source - Integrated this into ftFileCreator - added gui menu in file transfer+right click to change the chunk strategy: streaming vs. random Next step: - loading/saving file downloading state and availability map - displaying chunk details in the selected transfer tab (e.g. list of currently worked chunks, and their current downloading completion) git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@1863 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
de0cbd50ce
commit
25a09900e9
16 changed files with 584 additions and 173 deletions
|
@ -55,7 +55,8 @@ class peerInfo
|
|||
{
|
||||
public:
|
||||
peerInfo(std::string peerId_in):peerId(peerId_in),state(PQIPEER_NOT_ONLINE),desiredRate(0),actualRate(0),
|
||||
offset(0),chunkSize(0),receivedSize(0),lastTS(0),
|
||||
// offset(0),chunkSize(0),receivedSize(0),
|
||||
lastTS(0),
|
||||
recvTS(0), lastTransfers(0), nResets(0),
|
||||
rtt(0), rttActive(false), rttStart(0), rttOffset(0),
|
||||
mRateIncrease(1)
|
||||
|
@ -64,7 +65,8 @@ public:
|
|||
}
|
||||
peerInfo(std::string peerId_in,uint32_t state_in,uint32_t maxRate_in):
|
||||
peerId(peerId_in),state(state_in),desiredRate(maxRate_in),actualRate(0),
|
||||
offset(0),chunkSize(0),receivedSize(0),lastTS(0),
|
||||
// offset(0),chunkSize(0),receivedSize(0),
|
||||
lastTS(0),
|
||||
recvTS(0), lastTransfers(0), nResets(0),
|
||||
rtt(0), rttActive(false), rttStart(0), rttOffset(0),
|
||||
mRateIncrease(1)
|
||||
|
@ -77,11 +79,11 @@ public:
|
|||
double actualRate;
|
||||
|
||||
//current file data request
|
||||
uint64_t offset;
|
||||
uint32_t chunkSize;
|
||||
// uint64_t offset;
|
||||
// uint32_t chunkSize;
|
||||
|
||||
//already received data size for current request
|
||||
uint32_t receivedSize;
|
||||
// uint32_t receivedSize;
|
||||
|
||||
time_t lastTS; /* last Request */
|
||||
time_t recvTS; /* last Recv */
|
||||
|
@ -147,7 +149,7 @@ public:
|
|||
void requestData(std::string peerId, uint64_t offset, uint32_t chunk_size);
|
||||
|
||||
//interface to file creator
|
||||
bool getChunk(uint64_t &offset, uint32_t &chunk_size);
|
||||
bool getChunk(const std::string& peer_id,uint32_t size_hint,uint64_t &offset, uint32_t &chunk_size);
|
||||
bool storeData(uint64_t offset, uint32_t chunk_size, void *data);
|
||||
|
||||
int tick();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue