mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-02 14:16:16 -04:00
fixed a few bugs related to previous commit
git-svn-id: http://svn.code.sf.net/p/retroshare/code/branches/v0.5-GenericTunneling@6294 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
0abb21d962
commit
6760b35ae6
2 changed files with 22 additions and 15 deletions
|
@ -1109,17 +1109,17 @@ bool ftServer::sendData(const std::string& peerId, const std::string& hash, uint
|
|||
{
|
||||
RsTurtleFileDataItem *item = new RsTurtleFileDataItem ;
|
||||
|
||||
item->chunk_offset = offset ;
|
||||
item->chunk_size = chunksize ;
|
||||
item->chunk_data = malloc(chunksize) ;
|
||||
item->chunk_offset = offset+baseoffset ;
|
||||
item->chunk_size = chunk;
|
||||
item->chunk_data = malloc(chunk) ;
|
||||
|
||||
if(item->chunk_data == NULL)
|
||||
{
|
||||
std::cerr << "p3turtle: Warning: failed malloc of " << chunksize << " bytes for sending data packet." << std::endl ;
|
||||
std::cerr << "p3turtle: Warning: failed malloc of " << chunk << " bytes for sending data packet." << std::endl ;
|
||||
delete item;
|
||||
return false;
|
||||
}
|
||||
memcpy(item->chunk_data,(void*)((uint8_t*)data),chunksize) ;
|
||||
memcpy(item->chunk_data,&(((uint8_t *) data)[offset]),chunk) ;
|
||||
|
||||
mTurtleRouter->sendTurtleData(peerId,item) ;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue