workaround for impossible RAW msg

This commit is contained in:
Marcel Märtens 2020-08-22 00:50:01 +02:00
parent 7e9194eb73
commit 1eb126736d
3 changed files with 14 additions and 6 deletions

View File

@ -50,13 +50,13 @@ impl Channel {
//reapply leftovers from handshake //reapply leftovers from handshake
let cnt = leftover_cid_frame.len(); let cnt = leftover_cid_frame.len();
trace!(?self.cid, ?cnt, "Reapplying leftovers"); trace!(?cnt, "Reapplying leftovers");
for cid_frame in leftover_cid_frame.drain(..) { for cid_frame in leftover_cid_frame.drain(..) {
w2c_cid_frame_s.send(cid_frame).await.unwrap(); w2c_cid_frame_s.send(cid_frame).await.unwrap();
} }
trace!(?self.cid, ?cnt, "All leftovers reapplied"); trace!(?cnt, "All leftovers reapplied");
trace!(?self.cid, "Start up channel"); trace!("Start up channel");
match protocol { match protocol {
Protocols::Tcp(tcp) => { Protocols::Tcp(tcp) => {
join!( join!(
@ -72,7 +72,7 @@ impl Channel {
}, },
} }
trace!(?self.cid, "Shut down channel"); trace!("Shut down channel");
} }
} }
@ -148,7 +148,11 @@ impl Handshake {
} }
let cnt = leftover_frames.len(); let cnt = leftover_frames.len();
if cnt > 0 { if cnt > 0 {
debug!(?self.cid, ?cnt, "Some additional frames got already transfered, piping them to the bparticipant as leftover_frames"); debug!(
?cnt,
"Some additional frames got already transfered, piping them to the \
bparticipant as leftover_frames"
);
} }
Ok((res.0, res.1, res.2, leftover_frames)) Ok((res.0, res.1, res.2, leftover_frames))
}, },

View File

@ -448,7 +448,10 @@ impl BParticipant {
self.close_api(Some(ParticipantError::ParticipantDisconnected)) self.close_api(Some(ParticipantError::ParticipantDisconnected))
.await; .await;
}, },
f => unreachable!("Frame should never reache participant!: {:?}", f), f => {
//unreachable!("Frame should never reache participant!: {:?}", f);
error!(?f, ?cid, "Frame should never reache participant!");
},
} }
} }
if dropped_cnt > 0 { if dropped_cnt > 0 {

View File

@ -208,6 +208,7 @@ impl TcpProtocol {
//keep the first byte! //keep the first byte!
read_or_close!(&mut data[1..]); read_or_close!(&mut data[1..]);
data[0] = other; data[0] = other;
warn!(?data, "got a unexpected RAW msg");
Frame::Raw(data) Frame::Raw(data)
}, },
}; };