@@ -262,10 +262,11 @@ void ArchiveManager::get_key_block_proof(FileReference ref_id, td::Promise<td::B
262262}
263263
264264void ArchiveManager::get_temp_file_short (FileReference ref_id, td::Promise<td::BufferSlice> promise) {
265- get_file_short_cont (std::move (ref_id), get_max_temp_file_desc_idx (), std::move (promise));
265+ get_temp_file_short_cont (std::move (ref_id), get_max_temp_file_desc_idx (), std::move (promise));
266266}
267267
268- void ArchiveManager::get_file_short_cont (FileReference ref_id, PackageId idx, td::Promise<td::BufferSlice> promise) {
268+ void ArchiveManager::get_temp_file_short_cont (FileReference ref_id, PackageId idx,
269+ td::Promise<td::BufferSlice> promise) {
269270 auto f = get_temp_file_desc_by_idx (idx);
270271 if (!f) {
271272 promise.set_error (td::Status::Error (ErrorCode::notready, " file not in db" ));
@@ -276,7 +277,8 @@ void ArchiveManager::get_file_short_cont(FileReference ref_id, PackageId idx, td
276277 if (R.is_ok ()) {
277278 promise.set_value (R.move_as_ok ());
278279 } else {
279- td::actor::send_closure (SelfId, &ArchiveManager::get_file_short_cont, std::move (ref_id), idx, std::move (promise));
280+ td::actor::send_closure (SelfId, &ArchiveManager::get_temp_file_short_cont, std::move (ref_id), idx,
281+ std::move (promise));
280282 }
281283 });
282284 td::actor::send_closure (f->file_actor_id (), &ArchiveSlice::get_file, nullptr , std::move (ref_id), std::move (P));
@@ -294,20 +296,18 @@ void ArchiveManager::get_file(ConstBlockHandle handle, FileReference ref_id, td:
294296 if (handle->handle_moved_to_archive ()) {
295297 auto f = get_file_desc (handle->id ().shard_full (), get_package_id (handle->masterchain_ref_block ()), 0 , 0 , 0 , false );
296298 if (f) {
297- auto P = td::PromiseCreator::lambda ([SelfId = actor_id ( this ), ref_id, idx = get_max_temp_file_desc_idx ( ),
298- promise = std::move (promise )](td::Result<td::BufferSlice> R) mutable {
299+ promise = [=, promise = std::move (promise ),
300+ file_actor = f-> file_actor_id ( )](td::Result<td::BufferSlice> R) mutable {
299301 if (R.is_ok ()) {
300302 promise.set_value (R.move_as_ok ());
301- } else {
302- td::actor::send_closure (SelfId, &ArchiveManager::get_file_short_cont, ref_id, idx, std::move (promise));
303+ return ;
303304 }
304- });
305- td::actor::send_closure (f->file_actor_id (), &ArchiveSlice::get_file, std::move (handle), std::move (ref_id),
306- std::move (P));
307- return ;
305+ td::actor::send_closure (file_actor, &ArchiveSlice::get_file, std::move (handle), std::move (ref_id),
306+ std::move (promise));
307+ };
308308 }
309309 }
310- get_file_short_cont (std::move (ref_id), get_max_temp_file_desc_idx ( ), std::move (promise));
310+ get_temp_file_short (std::move (ref_id), std::move (promise));
311311}
312312
313313void ArchiveManager::register_perm_state (FileReferenceShort id) {
0 commit comments