Skip to content

Commit 04100a7

Browse files
authored
Merge pull request #7 from SamedhG/get-fix
Fix the minor bug in FtpStream::Get
2 parents 92fb11b + 1ba09ac commit 04100a7

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/ftp.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,11 @@ impl FtpStream {
296296
pub async fn get(&mut self, file_name: &str) -> Result<BufReader<DataStream>> {
297297
let retr_command = format!("RETR {}\r\n", file_name);
298298
let data_stream = BufReader::new(self.data_command(&retr_command).await?);
299-
self.read_response(status::ABOUT_TO_SEND).await?;
299+
self.read_response_in(&[
300+
status::CLOSING_DATA_CONNECTION,
301+
status::REQUESTED_FILE_ACTION_OK,
302+
])
303+
.await?;
300304
Ok(data_stream)
301305
}
302306

0 commit comments

Comments
 (0)