Handle incoming Reject messages when we expect a response
This commit is contained in:
parent
efd37300b9
commit
f5f1fe9bbc
|
@ -1,3 +1,4 @@
|
|||
use std::error::Error;
|
||||
use std::sync::Arc;
|
||||
|
||||
use futures::{
|
||||
|
@ -276,6 +277,24 @@ where
|
|||
}
|
||||
AwaitingRequest
|
||||
}
|
||||
(
|
||||
AwaitingResponse(_, tx),
|
||||
Message::Reject {
|
||||
message,
|
||||
ccode,
|
||||
reason,
|
||||
data,
|
||||
},
|
||||
) => {
|
||||
tx.send(Err(SharedPeerError::from(Arc::new(PeerError::Rejected))))
|
||||
.expect("response oneshot should be unused");
|
||||
|
||||
error!(
|
||||
"{:?} message rejected: {:?}, {:?}, {:?}",
|
||||
message, ccode, reason, data
|
||||
);
|
||||
AwaitingRequest
|
||||
}
|
||||
// By default, messages are not responses.
|
||||
(state, msg) => {
|
||||
ignored_msg = Some(msg);
|
||||
|
|
Loading…
Reference in New Issue