rpc: fixed missing read blocks (#1581)
* rpc: fixed missing read blocks * rpc: storage: restored old behavior * rpc: allocating 0 bytes for empty read Co-authored-by: あく <alleteam@gmail.com>
This commit is contained in:
		
							parent
							
								
									a39111ade2
								
							
						
					
					
						commit
						874eb46c93
					
				| @ -320,16 +320,21 @@ static void rpc_system_storage_read_process(const PB_Main* request, void* contex | |||||||
| 
 | 
 | ||||||
|                 response->has_next = fs_operation_success && (size_left > 0); |                 response->has_next = fs_operation_success && (size_left > 0); | ||||||
|             } else { |             } else { | ||||||
|                 response->content.storage_read_response.has_file = false; |                 response->content.storage_read_response.file.data = | ||||||
|  |                     malloc(PB_BYTES_ARRAY_T_ALLOCSIZE(0)); | ||||||
|  |                 response->content.storage_read_response.file.data->size = 0; | ||||||
|  |                 response->content.storage_read_response.has_file = true; | ||||||
|                 response->has_next = false; |                 response->has_next = false; | ||||||
|                 fs_operation_success = true; |                 fs_operation_success = true; | ||||||
|             } |             } | ||||||
|         } while((size_left != 0) && fs_operation_success); |  | ||||||
|     } |  | ||||||
| 
 | 
 | ||||||
|             if(fs_operation_success) { |             if(fs_operation_success) { | ||||||
|                 rpc_send_and_release(session, response); |                 rpc_send_and_release(session, response); | ||||||
|     } else { |             } | ||||||
|  |         } while((size_left != 0) && fs_operation_success); | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     if(!fs_operation_success) { | ||||||
|         rpc_send_and_release_empty( |         rpc_send_and_release_empty( | ||||||
|             session, request->command_id, rpc_system_storage_get_file_error(file)); |             session, request->command_id, rpc_system_storage_get_file_error(file)); | ||||||
|     } |     } | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 hedger
						hedger