INNER CODE UNIT · Rust
run
eepnet/emissary · emissary-cli/src/proxy/http/mod.rs:307
pub async fn run(mut self) -> anyhow::Result<()> {
loop {
tokio::select! {
connection = self.listener.accept() => match connection {
Ok((stream, _)) => {
self.requests.spawn(async move {
match tokio::time::timeout(Duration::from_secs(10), Self::read_request(stream)).await {
Err(_) => None,
Ok(Ok(request)) => Some(request),
Ok(Err((stream, error))) => {
tracing::debug!(
target: LOG_TARGET,
?error,
"failed to handle inbound http request",
);
send_response(stream, Status::BadRequest(error)).await;
None
}