Skip to content

Commit

Permalink
Fix panicking when Kad responder is destroyed (#575)
Browse files Browse the repository at this point in the history
  • Loading branch information
tomaka authored Oct 18, 2018
1 parent 1e223f6 commit 46dd6b6
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions protocols/kad/src/kad_server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -360,10 +360,11 @@ where
},
Some(EventSource::LocalResponse(message)) => {
let future = message
.map_err(|_| {
.map_err(|err| {
// The user destroyed the responder without responding.
warn!("Kad responder object destroyed without responding");
panic!() // TODO: what to do here? we have to close the connection
// TODO: what to do here? we have to close the connection
IoError::new(IoErrorKind::Other, err)
})
.and_then(move |message| {
kad_sink
Expand Down

0 comments on commit 46dd6b6

Please sign in to comment.