mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-13 11:32:48 -04:00
Addition of next stage of new FileTransfer Code:
* Completed rough ftExtraList class (with Test Case) * Added data flow interface (ftData.h) * Added ftDataMultiplex (server + client modules). * Finished parts of ftcontroller / ftserver. * Minor Tweaks to ftTransferModules interface for compilation. Related Changes in other parts of the code: * Added new Job/Queue Thread Class. * Added more user-friendly directory functions. * Added FileInfo print operator. git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@650 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
a9bda83565
commit
79727897dd
19 changed files with 1245 additions and 106 deletions
|
@ -37,7 +37,7 @@
|
|||
|
||||
#include <map>
|
||||
#include <list>
|
||||
#include <ftFileCreator.h>
|
||||
#include "ft/ftfilecreator.h"
|
||||
|
||||
class Request
|
||||
{
|
||||
|
@ -47,7 +47,7 @@ class Request
|
|||
|
||||
class peerInfo
|
||||
{
|
||||
std:string peerId;
|
||||
std::string peerId;
|
||||
uint16_t state;
|
||||
uint32_t desiredRate;
|
||||
Request lastRequest;
|
||||
|
@ -71,21 +71,26 @@ public:
|
|||
bool completeFileTransfer();
|
||||
|
||||
//interface to client module
|
||||
bool recvFileData(uint64_t offset, uint32_t chunk_size, void *data);
|
||||
void requestData(std::hash, uint64_t offset, uint32_t chunk_size);
|
||||
bool recvFileData(std::string peerId, uint64_t offset,
|
||||
uint32_t chunk_size, void *data);
|
||||
void requestData(std::string hash, uint64_t offset, uint32_t chunk_size);
|
||||
|
||||
//interface to file creator
|
||||
bool getChunk(uint64_t &offset, uint32_t &chunk_size);
|
||||
bool storeData(uint64_t offset, uint32_t chunk_size);
|
||||
|
||||
void tick();
|
||||
|
||||
|
||||
/* add by DrBob for interfaces */
|
||||
std::string hash() { return mHash; }
|
||||
uint64_t size() { return mSize; }
|
||||
|
||||
public:
|
||||
ftFileCreator* fc;
|
||||
|
||||
private:
|
||||
std::string hash;
|
||||
uint64_t size;
|
||||
std::string mHash;
|
||||
uint64_t mSize;
|
||||
uint32_t dataRate; //data transfer rate for current file
|
||||
uint16_t state; //file transfer state
|
||||
std::list<std::string> onlinePeerList;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue