Fix panicking when Kad responder is destroyed (#575)

This commit is contained in:
Pierre Krieger 2018-10-18 17:03:47 +01:00 committed by GitHub
parent 1e223f627d
commit 46dd6b61b2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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