mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-08-20 03:48:16 -04:00
- implemented bidirectional exchange of chunk maps for direct downloads, to allow showing proper completion of transfers from direct friends.
- moved the direction flag upward in the pipeline (ftDataSend instead of p3turtle) git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@3313 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
569ac25843
commit
cee8600a93
13 changed files with 483 additions and 71 deletions
|
@ -311,7 +311,14 @@ int pqihandler::SendFileData(RsFileData *ns)
|
|||
{
|
||||
return HandleRsItem(ns, 0);
|
||||
}
|
||||
|
||||
int pqihandler::SendFileChunkMapRequest(RsFileChunkMapRequest *ns)
|
||||
{
|
||||
return HandleRsItem(ns, 0);
|
||||
}
|
||||
int pqihandler::SendFileChunkMap(RsFileChunkMap *ns)
|
||||
{
|
||||
return HandleRsItem(ns, 0);
|
||||
}
|
||||
int pqihandler::SendRsRawItem(RsRawItem *ns)
|
||||
{
|
||||
pqioutput(PQL_DEBUG_BASIC, pqihandlerzone,
|
||||
|
@ -450,24 +457,35 @@ void pqihandler::locked_SortnStoreItem(RsItem *item)
|
|||
|
||||
case RS_PKT_TYPE_FILE:
|
||||
switch(subtype)
|
||||
{
|
||||
case RS_PKT_SUBTYPE_FI_REQUEST:
|
||||
pqioutput(PQL_DEBUG_BASIC, pqihandlerzone,
|
||||
"SortnStore -> File Request");
|
||||
in_request.push_back(item);
|
||||
item = NULL;
|
||||
break;
|
||||
{
|
||||
case RS_PKT_SUBTYPE_FI_REQUEST:
|
||||
pqioutput(PQL_DEBUG_BASIC, pqihandlerzone,
|
||||
"SortnStore -> File Request");
|
||||
in_request.push_back(item);
|
||||
item = NULL;
|
||||
break;
|
||||
|
||||
case RS_PKT_SUBTYPE_FI_DATA:
|
||||
pqioutput(PQL_DEBUG_BASIC, pqihandlerzone,
|
||||
"SortnStore -> File Data");
|
||||
in_data.push_back(item);
|
||||
item = NULL;
|
||||
break;
|
||||
case RS_PKT_SUBTYPE_FI_DATA:
|
||||
pqioutput(PQL_DEBUG_BASIC, pqihandlerzone, "SortnStore -> File Data");
|
||||
in_data.push_back(item);
|
||||
item = NULL;
|
||||
break;
|
||||
|
||||
default:
|
||||
break; /* no match! */
|
||||
}
|
||||
case RS_PKT_SUBTYPE_FI_CHUNK_MAP_REQUEST:
|
||||
pqioutput(PQL_DEBUG_BASIC, pqihandlerzone, "SortnStore -> File ChunkMap Request");
|
||||
in_chunkmap_request.push_back(item);
|
||||
item = NULL;
|
||||
break;
|
||||
|
||||
case RS_PKT_SUBTYPE_FI_CHUNK_MAP:
|
||||
pqioutput(PQL_DEBUG_BASIC, pqihandlerzone, "SortnStore -> File ChunkMap");
|
||||
in_chunkmap.push_back(item);
|
||||
item = NULL;
|
||||
break;
|
||||
|
||||
default:
|
||||
break; /* no match! */
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
|
@ -549,6 +567,34 @@ RsFileData *pqihandler::GetFileData()
|
|||
}
|
||||
return NULL;
|
||||
}
|
||||
RsFileChunkMapRequest *pqihandler::GetFileChunkMapRequest()
|
||||
{
|
||||
RsStackMutex stack(coreMtx); /**************** LOCKED MUTEX ****************/
|
||||
|
||||
if (in_chunkmap_request.size() != 0)
|
||||
{
|
||||
RsFileChunkMapRequest *fi = dynamic_cast<RsFileChunkMapRequest *>(in_chunkmap_request.front());
|
||||
if (!fi) { delete in_chunkmap_request.front(); }
|
||||
in_chunkmap_request.pop_front();
|
||||
return fi;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
RsFileChunkMap *pqihandler::GetFileChunkMap()
|
||||
{
|
||||
RsStackMutex stack(coreMtx); /**************** LOCKED MUTEX ****************/
|
||||
|
||||
if (in_chunkmap.size() != 0)
|
||||
{
|
||||
RsFileChunkMap *fi = dynamic_cast<RsFileChunkMap *>(in_chunkmap.front());
|
||||
if (!fi) { delete in_chunkmap.front(); }
|
||||
in_chunkmap.pop_front();
|
||||
return fi;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
|
||||
RsRawItem *pqihandler::GetRsRawItem()
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue