mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
This commit is contained in:
commit
3155c31e66
@ -331,12 +331,19 @@ impl BParticipant {
|
|||||||
prio,
|
prio,
|
||||||
promises,
|
promises,
|
||||||
} => {
|
} => {
|
||||||
|
trace!(?sid, ?prio, ?promises, "Opened frame from remote");
|
||||||
let a2p_msg_s = a2p_msg_s.clone();
|
let a2p_msg_s = a2p_msg_s.clone();
|
||||||
let stream = self
|
let stream = self
|
||||||
.create_stream(sid, prio, promises, a2p_msg_s, &a2b_close_stream_s)
|
.create_stream(sid, prio, promises, a2p_msg_s, &a2b_close_stream_s)
|
||||||
.await;
|
.await;
|
||||||
b2a_stream_opened_s.send(stream).await.unwrap();
|
if let Err(e) = b2a_stream_opened_s.send(stream).await {
|
||||||
trace!("Opened frame from remote");
|
warn!(
|
||||||
|
?e,
|
||||||
|
?sid,
|
||||||
|
"couldn't notify api::Participant that a stream got opened. Is the \
|
||||||
|
participant already dropped?"
|
||||||
|
);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
Frame::CloseStream { sid } => {
|
Frame::CloseStream { sid } => {
|
||||||
// Closing is realised by setting a AtomicBool to true, however we also have a
|
// Closing is realised by setting a AtomicBool to true, however we also have a
|
||||||
|
@ -643,6 +643,7 @@ impl Server {
|
|||||||
) -> Result<(), Error> {
|
) -> Result<(), Error> {
|
||||||
//TIMEOUT 0.1 ms for msg handling
|
//TIMEOUT 0.1 ms for msg handling
|
||||||
const TIMEOUT: Duration = Duration::from_micros(100);
|
const TIMEOUT: Duration = Duration::from_micros(100);
|
||||||
|
const SLOWLORIS_TIMEOUT: Duration = Duration::from_millis(300);
|
||||||
loop {
|
loop {
|
||||||
let participant = match select!(
|
let participant = match select!(
|
||||||
_ = Delay::new(TIMEOUT).fuse() => None,
|
_ = Delay::new(TIMEOUT).fuse() => None,
|
||||||
@ -654,7 +655,7 @@ impl Server {
|
|||||||
debug!("New Participant connected to the server");
|
debug!("New Participant connected to the server");
|
||||||
|
|
||||||
let singleton_stream = match select!(
|
let singleton_stream = match select!(
|
||||||
_ = Delay::new(TIMEOUT*100).fuse() => None,
|
_ = Delay::new(SLOWLORIS_TIMEOUT).fuse() => None,
|
||||||
sr = participant.opened().fuse() => Some(sr),
|
sr = participant.opened().fuse() => Some(sr),
|
||||||
) {
|
) {
|
||||||
None => {
|
None => {
|
||||||
|
Loading…
Reference in New Issue
Block a user