mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-23 16:21:29 -04:00
- Restored compilation of most tests (The part using previously named p3ConnectMgr is still to be done).
- moved ftSearchDummy and ftDataSendPair in tests/ft since it is only used there. git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@6009 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
6571279b70
commit
bc65dd40c2
48 changed files with 314 additions and 1797 deletions
|
@ -101,92 +101,4 @@ class ftDataRecv
|
|||
virtual bool recvCRC32Map(const std::string& peer_id,const std::string& hash,const CRC32Map& crcmap) = 0;
|
||||
};
|
||||
|
||||
/**************** FOR TESTING ***********************/
|
||||
|
||||
/******* Pair of Send/Recv (Only need to handle Send side) ******/
|
||||
class ftDataSendPair: public ftDataSend
|
||||
{
|
||||
public:
|
||||
|
||||
ftDataSendPair(ftDataRecv *recv);
|
||||
virtual ~ftDataSendPair() { return; }
|
||||
|
||||
/* Client Send */
|
||||
virtual bool sendDataRequest(const std::string &peerId, const std::string &hash,
|
||||
uint64_t size, uint64_t offset, uint32_t chunksize);
|
||||
|
||||
/* Server Send */
|
||||
virtual bool sendData(const std::string &peerId, const std::string &hash, uint64_t size,
|
||||
uint64_t offset, uint32_t chunksize, void *data);
|
||||
|
||||
/* Send a request for a chunk map */
|
||||
virtual bool sendChunkMapRequest(const std::string& peer_id,const std::string& hash,bool is_client);
|
||||
|
||||
/* Send a chunk map */
|
||||
virtual bool sendChunkMap(const std::string& peer_id,const std::string& hash, const CompressedChunkMap& cmap,bool is_client);
|
||||
|
||||
/* Send a request for a chunk map */
|
||||
virtual bool sendCRC32MapRequest(const std::string& peer_id,const std::string& hash);
|
||||
|
||||
/* Send a chunk map */
|
||||
virtual bool sendCRC32Map(const std::string& peer_id,const std::string& hash, const CRC32Map& cmap);
|
||||
ftDataRecv *mDataRecv;
|
||||
};
|
||||
|
||||
|
||||
class ftDataSendDummy: public ftDataSend
|
||||
{
|
||||
public:
|
||||
virtual ~ftDataSendDummy() { return; }
|
||||
|
||||
/* Client Send */
|
||||
virtual bool sendDataRequest(const std::string &peerId, const std::string &hash,
|
||||
uint64_t size, uint64_t offset, uint32_t chunksize);
|
||||
|
||||
/* Server Send */
|
||||
virtual bool sendData(const std::string &peerId, const std::string &hash, uint64_t size,
|
||||
uint64_t offset, uint32_t chunksize, void *data);
|
||||
|
||||
/* Send a request for a chunk map */
|
||||
virtual bool sendChunkMapRequest(const std::string& peer_id,const std::string& hash,bool is_client);
|
||||
|
||||
/* Send a chunk map */
|
||||
virtual bool sendChunkMap(const std::string& peer_id,const std::string& hash, const CompressedChunkMap& cmap,bool is_client);
|
||||
|
||||
/* Send a request for a chunk map */
|
||||
virtual bool sendCRC32MapRequest(const std::string& peer_id,const std::string& hash);
|
||||
|
||||
/* Send a chunk map */
|
||||
virtual bool sendCRC32Map(const std::string& peer_id,const std::string& hash, const CRC32Map& cmap);
|
||||
};
|
||||
|
||||
class ftDataRecvDummy: public ftDataRecv
|
||||
{
|
||||
public:
|
||||
|
||||
virtual ~ftDataRecvDummy() { return; }
|
||||
|
||||
/* Client Recv */
|
||||
virtual bool recvData(const std::string& peerId, const std::string& hash,
|
||||
uint64_t size, uint64_t offset, uint32_t chunksize, void *data);
|
||||
|
||||
/* Server Recv */
|
||||
virtual bool recvDataRequest(const std::string& peerId, const std::string& hash,
|
||||
uint64_t size, uint64_t offset, uint32_t chunksize);
|
||||
|
||||
/* Send a request for a chunk map */
|
||||
virtual bool recvChunkMapRequest(const std::string& peer_id,const std::string& hash,
|
||||
bool is_client);
|
||||
|
||||
/* Send a chunk map */
|
||||
virtual bool recvChunkMap(const std::string& peer_id,const std::string& hash,
|
||||
const CompressedChunkMap& cmap,bool is_client);
|
||||
|
||||
/* Send a request for a chunk map */
|
||||
virtual bool sendCRC32MapRequest(const std::string& peer_id,const std::string& hash);
|
||||
|
||||
/* Send a chunk map */
|
||||
virtual bool sendCRC32Map(const std::string& peer_id,const std::string& hash, const CompressedChunkMap& cmap);
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue