keep-alive
This commit is contained in:
parent
493a54ef6c
commit
1ae196d322
@ -17,6 +17,7 @@ pub async fn handler_connection<S: HttpServer + Send + 'static + Sync>(
|
||||
) {
|
||||
let Ok(addr) = sock.get_ref().peer_addr() else { return; };
|
||||
|
||||
loop {
|
||||
let req = match HttpRequest::read(sock.get_mut(), &addr).await {
|
||||
Ok(i) => i,
|
||||
Err(e) => {
|
||||
@ -39,7 +40,7 @@ pub async fn handler_connection<S: HttpServer + Send + 'static + Sync>(
|
||||
return;
|
||||
},
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#[macro_export]
|
||||
@ -55,6 +56,7 @@ pub async fn handler_flowgate<S: HttpServer + Send + 'static + Sync>(
|
||||
server: Arc<S>,
|
||||
mut sock: Stream,
|
||||
) {
|
||||
loop {
|
||||
let addr = match read_line_lf(sock.get_mut()).await {
|
||||
Ok(i) => i,
|
||||
Err(e) => {
|
||||
@ -89,3 +91,4 @@ pub async fn handler_flowgate<S: HttpServer + Send + 'static + Sync>(
|
||||
},
|
||||
}
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user