Improved the code in send_file_entry() and receive_file_entry() to