Ensure connection is closed on abort (#801)
When aborting a connection, ensure the underlying stream is closed before we return.
This commit is contained in:
@@ -194,6 +194,7 @@ impl AsyncSmtpConnection {
|
||||
self.panic = true;
|
||||
let _ = self.command(Quit).await;
|
||||
}
|
||||
let _ = self.stream.close().await;
|
||||
}
|
||||
|
||||
/// Sets the underlying stream
|
||||
|
||||
@@ -183,6 +183,7 @@ impl SmtpConnection {
|
||||
self.panic = true;
|
||||
let _ = self.command(Quit);
|
||||
}
|
||||
let _ = self.stream.get_mut().shutdown(std::net::Shutdown::Both);
|
||||
}
|
||||
|
||||
/// Sets the underlying stream
|
||||
|
||||
Reference in New Issue
Block a user