mirror of
https://github.com/uroni/urbackup_backend.git
synced 2025-10-26 11:36:50 +00:00
Properly handle transfer hash if partition ends on VHD block boundary and last block is available
(cherry picked from commit 4dfff297de)
Conflicts:
urbackupserver/server_image.cpp
(cherry picked from commit ad659afb1e847a339799ab0937900bfeb3341363)
This commit is contained in:
parent
fb294f04d2
commit
cf69d312ea
@ -390,7 +390,7 @@ bool BackupServerGet::doImage(const std::string &pLetter, const std::wstring &pP
|
||||
}
|
||||
else
|
||||
{
|
||||
ServerLogger::Log(clientid, "Pipe to client unexpectedly closed has_error="+nconvert(cc->hasError()), LL_ERROR);
|
||||
ServerLogger::Log(clientid, "Pipe to client unexpectedly closed has_error="+(cc==NULL?"NULL":nconvert(cc->hasError())), LL_ERROR);
|
||||
goto do_image_cleanup;
|
||||
}
|
||||
}
|
||||
@ -715,9 +715,13 @@ bool BackupServerGet::doImage(const std::string &pLetter, const std::wstring &pP
|
||||
}
|
||||
}
|
||||
|
||||
transferred_bytes+=cc->getTransferedBytes();
|
||||
Server->destroy(cc);
|
||||
if(cc!=NULL)
|
||||
{
|
||||
transferred_bytes+=cc->getTransferedBytes();
|
||||
Server->destroy(cc);
|
||||
}
|
||||
if(hashfile!=NULL) Server->destroy(hashfile);
|
||||
|
||||
if(vhdfile!=NULL)
|
||||
{
|
||||
vhdfile->freeBuffer(blockdata);
|
||||
@ -821,7 +825,7 @@ bool BackupServerGet::doImage(const std::string &pLetter, const std::wstring &pP
|
||||
memcpy(&dig, &buffer[off+2*sizeof(int64)], sha_size);
|
||||
|
||||
|
||||
if( (nextblock<hblock || hblock==blocks) && hblock>0)
|
||||
if( (nextblock<hblock || (hblock==blocks && nextblock%vhd_blocksize!=0) ) && hblock>0)
|
||||
{
|
||||
if(nextblock<hblock)
|
||||
{
|
||||
|
||||
Loading…
Reference in New Issue
Block a user