Break reading loop as soon as client closes the connection
This commit is contained in:
parent
9c77c7f5d7
commit
d6118657a8
1 changed files with 4 additions and 2 deletions
|
|
@ -69,7 +69,7 @@ pub async fn handle_request(socket: TcpStream, upstream: TcpStream) -> Result<()
|
||||||
}
|
}
|
||||||
None => {
|
None => {
|
||||||
info!("Client closed the connection");
|
info!("Client closed the connection");
|
||||||
return Ok(())
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -90,12 +90,14 @@ pub async fn handle_request(socket: TcpStream, upstream: TcpStream) -> Result<()
|
||||||
}
|
}
|
||||||
None => {
|
None => {
|
||||||
info!("Server closed the connection");
|
info!("Server closed the connection");
|
||||||
return Ok(())
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
fn replace_address(message: String) -> String {
|
fn replace_address(message: String) -> String {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue