diff --git a/urbackupserver/server_get.cpp b/urbackupserver/server_get.cpp index 18feae96..9438f717 100644 --- a/urbackupserver/server_get.cpp +++ b/urbackupserver/server_get.cpp @@ -122,10 +122,10 @@ BackupServerGet::BackupServerGet(IPipe *pPipe, sockaddr_in pAddr, const std::wst SSettings tmp = {}; curr_intervals = tmp; - last_image_backup_try=0; + last_image_backup_try=0; count_image_backup_try=0; - last_file_backup_try=0; + last_file_backup_try=0; count_file_backup_try=0; hash_existing_mutex = Server->createMutex(); @@ -2730,8 +2730,8 @@ bool BackupServerGet::doIncrBackup(bool with_hashes, bool intra_file_diffs, bool if(copy_curr_file_entry_sparse) { - std::string curr_path = curr_path + "/" + Server->ConvertToUTF8(cf.name); - int crc32 = static_cast(adler32(0, curr_path.c_str(), static_cast(curr_path.size()))); + std::string curr_file_path = Server->ConvertToUTF8(curr_path + L"/" + cf.name); + int crc32 = static_cast(adler32(0, curr_file_path.c_str(), static_cast(curr_file_path.size()))); if(crc32 % copy_file_entries_sparse_modulo == incremental_num ) { if(trust_client_hashes && !curr_sha2.empty()) @@ -2759,7 +2759,10 @@ bool BackupServerGet::doIncrBackup(bool with_hashes, bool intra_file_diffs, bool } server_download->queueStop(false); - server_hash_existing->queueStop(false); + if(server_hash_existing.get()) + { + server_hash_existing->queueStop(false); + } while(!Server->getThreadPool()->waitFor(server_download_ticket, 1000)) @@ -4776,13 +4779,13 @@ unsigned int BackupServerGet::exponentialBackoffTime( size_t count, unsigned int bool BackupServerGet::exponentialBackoff(size_t count, int64 lasttime, unsigned int sleeptime, unsigned div) { - if(count>0) - { - unsigned int passed_time=static_cast(Server->getTimeSeconds()-lasttime); - unsigned int sleeptime_exp = exponentialBackoffTime(count, sleeptime, div); - - return passed_time>=sleeptime_exp; - } + if(count>0) + { + unsigned int passed_time=static_cast(Server->getTimeSeconds()-lasttime); + unsigned int sleeptime_exp = exponentialBackoffTime(count, sleeptime, div); + + return passed_time>=sleeptime_exp; + } return true; } @@ -4800,14 +4803,14 @@ unsigned int BackupServerGet::exponentialBackoffTimeFile() -bool BackupServerGet::exponentialBackoffImage() -{ - return exponentialBackoff(count_image_backup_try, last_image_backup_try, c_sleeptime_failed_imagebackup, c_exponential_backoff_div); -} - -bool BackupServerGet::exponentialBackoffFile() -{ - return exponentialBackoff(count_file_backup_try, last_file_backup_try, c_sleeptime_failed_filebackup, c_exponential_backoff_div); +bool BackupServerGet::exponentialBackoffImage() +{ + return exponentialBackoff(count_image_backup_try, last_image_backup_try, c_sleeptime_failed_imagebackup, c_exponential_backoff_div); +} + +bool BackupServerGet::exponentialBackoffFile() +{ + return exponentialBackoff(count_file_backup_try, last_file_backup_try, c_sleeptime_failed_filebackup, c_exponential_backoff_div); } bool BackupServerGet::authenticatePubKey()