fix bug and somewhat reusable streams
This commit is contained in:
parent
39493beb53
commit
aa95ab9c16
3 changed files with 19 additions and 12 deletions
|
|
@ -144,11 +144,19 @@ where
|
|||
let peekable_incoming = std::pin::Pin::new(&mut p);
|
||||
if let Some(conn) = peekable_incoming.get_mut().next().await {
|
||||
if success {
|
||||
// TODO: client数の管理
|
||||
let clients_count = self.globals.clients_count.clone();
|
||||
if clients_count.increment() > self.globals.max_clients {
|
||||
clients_count.decrement();
|
||||
continue;
|
||||
}
|
||||
let fut = self.clone().client_serve_h3(conn);
|
||||
self.globals.runtime_handle.spawn(async {
|
||||
self.globals.runtime_handle.spawn(async move {
|
||||
if let Err(e) = fut.await {
|
||||
warn!("QUIC or HTTP/3 connection failed: {}", e)
|
||||
}
|
||||
clients_count.decrement();
|
||||
debug!("Client #: {}", clients_count.current());
|
||||
});
|
||||
}
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue