Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -393,10 +393,10 @@ async fn process_stream<F, T>(
}
let stream = RewindStream::new(leftover, stream);
// Hand the connection to the application for processing.
// We already run `process_stream` inside a task, so spawning again
// only adds overhead.
let app = (factory)();
tokio::spawn(async move {
app.handle_connection(stream).await;
});
app.handle_connection(stream).await;
}
Err(err) => {
if let Some(handler) = on_failure.as_ref() {
Expand Down