mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-06-22 05:14:31 -04:00
Major bugfixes and testing changes for ft.
It is now almost ready for integration with rs. Added ftserver3test.cc which successfully tests: * Hashing of a directory. * Transfer of Cache Files. * Local Searching. * Remote Searching. * Download from multiple sources. git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@773 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
889825b77e
commit
88ef2e0e34
17 changed files with 1010 additions and 106 deletions
|
@ -21,6 +21,14 @@ int main()
|
|||
/* use creator to make it */
|
||||
|
||||
void *data = malloc(max_chunk);
|
||||
for(int i = 0; i < max_chunk; i++)
|
||||
{
|
||||
((uint8_t *) data)[i] = 'a' + i % 27;
|
||||
if (i % 27 == 26)
|
||||
{
|
||||
((uint8_t *) data)[i] = '\n';
|
||||
}
|
||||
}
|
||||
|
||||
ftFileCreator *creator = new ftFileCreator(filename, size, "hash", 0);
|
||||
for(offset = 0; offset != size; offset += chunk)
|
||||
|
@ -45,6 +53,17 @@ int main()
|
|||
|
||||
while(creator->getMissingChunk(offset, chunk))
|
||||
{
|
||||
if (chunk == 0)
|
||||
{
|
||||
std::cerr << "All currently allocated .... waiting";
|
||||
std::cerr << std::endl;
|
||||
sleep(1);
|
||||
/* reset chunk size */
|
||||
chunk = (uint64_t) max_chunk * (rand() / (1.0 + RAND_MAX));
|
||||
std::cerr << "ChunkSize = " << chunk << std::endl;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!provider->getFileData(offset, chunk, data))
|
||||
{
|
||||
FAILED("Read from Test Data File");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue