aboutsummaryrefslogtreecommitdiff
path: root/src/conn.rs
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2020-12-04 17:12:10 +0100
committerAlex Auvolat <alex@adnab.me>2020-12-04 17:12:10 +0100
commitb247f02c2907def0b569c958a589754dddc31012 (patch)
tree264d0e304a5bf4500ec1e9c31ba32dbd1d78991a /src/conn.rs
parent45766aa5d74b4570286c1298b21baac2c4727c48 (diff)
downloadnetapp-b247f02c2907def0b569c958a589754dddc31012.tar.gz
netapp-b247f02c2907def0b569c958a589754dddc31012.zip
Don't close connection at first (stupid) excuse
Diffstat (limited to 'src/conn.rs')
-rw-r--r--src/conn.rs8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/conn.rs b/src/conn.rs
index 7f869e8..d4362e5 100644
--- a/src/conn.rs
+++ b/src/conn.rs
@@ -216,7 +216,9 @@ impl ClientConn {
if let Some((id, resp)) = resp {
trace!("dispatch_resp: got resp to {}, {} bytes", id, resp.len());
if let Some(ch) = resp_notify.remove(&id) {
- ch.send(resp).map_err(|_| Error::Message("Could not dispatch reply".to_string()))?;
+ if ch.send(resp).is_err() {
+ debug!("Could not dispatch reply (channel probably closed, happens if request was canceled)");
+ }
} else {
resps.insert(id, resp);
}
@@ -226,7 +228,9 @@ impl ClientConn {
if let Some((id, resp_ch)) = resp_ch {
trace!("dispatch_resp: got resp_ch {}", id);
if let Some(rs) = resps.remove(&id) {
- resp_ch.send(rs).map_err(|_| Error::Message("Could not dispatch reply".to_string()))?;
+ if resp_ch.send(rs).is_err() {
+ debug!("Could not dispatch reply (channel probably closed, happens if request was canceled)");
+ }
} else {
resp_notify.insert(id, resp_ch);
}