dropping messages if there are no clients connected
This commit is contained in:
parent
86f29e6972
commit
bd9bad2eed
|
@ -7,6 +7,7 @@ use super::quiche_server_loop::server_loop;
|
|||
pub struct QuicServer {
|
||||
pub data_channel_sender: mio_channel::Sender<ChannelMessage>,
|
||||
pub quic_plugin_config: ConfigQuicPlugin,
|
||||
_server_loop_jh: std::thread::JoinHandle<()>,
|
||||
}
|
||||
|
||||
impl Debug for QuicServer {
|
||||
|
@ -38,6 +39,7 @@ impl QuicServer {
|
|||
Ok(QuicServer {
|
||||
data_channel_sender,
|
||||
quic_plugin_config: config,
|
||||
_server_loop_jh,
|
||||
})
|
||||
}
|
||||
|
||||
|
|
|
@ -230,6 +230,12 @@ pub fn server_loop(
|
|||
}
|
||||
|
||||
if events.iter().any(|x| x.token() == Token(1)) {
|
||||
if clients.is_empty() {
|
||||
// no clients, no need to process messages
|
||||
while message_send_queue.try_recv().is_ok() {
|
||||
// do nothing / clearing the queue
|
||||
}
|
||||
}
|
||||
// check if streams are already full, avoid depiling messages if it is full
|
||||
if !clients.iter().all(|x| {
|
||||
if x.1.partial_responses.is_empty() {
|
||||
|
|
Loading…
Reference in New Issue