mirror of
https://github.com/YGGverse/aquatic.git
synced 2026-03-31 17:55:36 +00:00
aquatic_http: use const LISTENER_TOKEN for clarity
This commit is contained in:
parent
0a23b62bd5
commit
2893fffd20
2 changed files with 5 additions and 2 deletions
|
|
@ -17,6 +17,9 @@ use aquatic_http_protocol::request::Request;
|
|||
use aquatic_http_protocol::response::{Response, ResponsePeer};
|
||||
|
||||
|
||||
pub const LISTENER_TOKEN: Token = Token(0);
|
||||
|
||||
|
||||
pub trait Ip: Copy + Eq + ::std::hash::Hash {}
|
||||
|
||||
impl Ip for Ipv4Addr {}
|
||||
|
|
|
|||
|
|
@ -92,7 +92,7 @@ pub fn run_poll_loop(
|
|||
for event in events.iter(){
|
||||
let token = event.token();
|
||||
|
||||
if token.0 == 0 {
|
||||
if token == LISTENER_TOKEN {
|
||||
accept_new_streams(
|
||||
&config,
|
||||
&mut listener,
|
||||
|
|
@ -148,7 +148,7 @@ fn accept_new_streams(
|
|||
Ok((mut stream, _)) => {
|
||||
poll_token_counter.0 = poll_token_counter.0.wrapping_add(1);
|
||||
|
||||
if poll_token_counter.0 == 0 {
|
||||
if *poll_token_counter == LISTENER_TOKEN {
|
||||
poll_token_counter.0 = 1;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue