Version
hyper 0.14.16
Platform
windows
Description
the task was canceled when the http connection closed
One way to structure the description:
[short summary of the bug]
task canceled when client connection closed.
I tried this code:
async fn hello_world(_req: Request<Body>) -> Result<Response<Body>, Infallible> {
println!("start sleep!!!!!");
tokio::time::sleep(tokio::time::Duration::from_secs(20)).await;
println!("end sleep!!!!");
Ok(Response::new("Hello, World".into()))
}
#[tokio::main]
async fn main() {
// We'll bind to 127.0.0.1:3000
let addr = SocketAddr::from(([127, 0, 0, 1], 3000));
// A `Service` is needed for every connection, so this
// creates one from our `hello_world` function.
let make_svc = make_service_fn(|_conn| async {
// service_fn converts our function into a `Service`
Ok::<_, Infallible>(service_fn(hello_world))
});
let server = Server::bind(&addr).serve(make_svc);
// Run this server for... forever!
if let Err(e) = server.await {
eprintln!("server error: {}", e);
}
}
[code sample that causes the bug]
i tried curl --location --request POST 'http://127.0.0.1:3030'.and then, abort request. the server side just print "start sleep!!!!!".not print "end sleep!!!!"
I expected to see this happen: [explanation]
i want to see print "end sleep!!!!"
Instead, this happened: [explanation]
Version
hyper 0.14.16
Platform
windows
Description
the task was canceled when the http connection closed
One way to structure the description:
[short summary of the bug]
task canceled when client connection closed.
I tried this code:
[code sample that causes the bug]
i tried
curl --location --request POST 'http://127.0.0.1:3030'.and then, abort request. the server side just print "start sleep!!!!!".not print "end sleep!!!!"I expected to see this happen: [explanation]
i want to see print "end sleep!!!!"
Instead, this happened: [explanation]