mirror of
https://github.com/samsonjs/agate.git
synced 2026-03-25 09:05:50 +00:00
always shut down connection properly
This commit is contained in:
parent
24d6a7d7ba
commit
99494e148b
1 changed files with 6 additions and 6 deletions
12
src/main.rs
12
src/main.rs
|
|
@ -386,12 +386,12 @@ impl RequestHandle {
|
|||
Err((status, msg)) => self.send_header(status, msg).await,
|
||||
};
|
||||
|
||||
if let Err(e) = result {
|
||||
Err(format!("{} error:{}", self.log_line, e))
|
||||
} else if let Err(e) = self.stream.shutdown().await {
|
||||
Err(format!("{} error:{}", self.log_line, e))
|
||||
} else {
|
||||
Ok(self.log_line)
|
||||
let close_result = self.stream.shutdown().await;
|
||||
|
||||
match (result, close_result) {
|
||||
(Err(e), _) => Err(format!("{} error:{}", self.log_line, e)),
|
||||
(Ok(_), Err(e)) => Err(format!("{} error:{}", self.log_line, e)),
|
||||
(Ok(_), Ok(_)) => Ok(self.log_line),
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue