Browse Source

Don't error if listener exits because of `ConnectionReset` error

tags/v0.2.0-candidate
Philipp Oppermann 2 years ago
parent
commit
9e2dca0e82
Failed to extract signature
1 changed files with 5 additions and 3 deletions
  1. +5
    -3
      binaries/daemon/src/listener/tcp.rs

+ 5
- 3
binaries/daemon/src/listener/tcp.rs View File

@@ -1,3 +1,5 @@
use std::io::ErrorKind;

use super::Listener;
use crate::{
shared_mem_handler,
@@ -58,9 +60,9 @@ impl super::Connection for TcpConnection {
let raw = match tcp_receive(&mut self.0).await {
Ok(raw) => raw,
Err(err) => match err.kind() {
std::io::ErrorKind::UnexpectedEof | std::io::ErrorKind::ConnectionAborted => {
return Ok(None)
}
ErrorKind::UnexpectedEof
| ErrorKind::ConnectionAborted
| ErrorKind::ConnectionReset => return Ok(None),
_other => {
return Err(err)
.context("unexpected I/O error while trying to receive DaemonRequest")


Loading…
Cancel
Save