Skip to content

Updating http/hyper to version 1. #411

@plugwash

Description

@plugwash

In Debian trixie we will be shipping both versions 0.x and 1.x of the http and hyper crates, however for the release after trixie we would like to get rid of the old packages. Your application is one of the last remaining applications that does not have a patch available to use hyper version 1.

There are some changes to data types, which I was able to easilly patch, but then I ran into a bigger change. The Sever class has gone away, applications are now expected to write their own accept loop.

However, before I rewrite that chunk of code, I want to fully understand what the existing code is trying to do, and right now I have a doubt.

let graceful = res.with_graceful_shutdown(async {
    rx.await.ok();
});

if let Err(e) = graceful.await {
    error!("server error: {}", e);
}
let _ = tx.send(());

This code appears to be setting up a graceful shutdown mechanism, but not actually setting up anything to cause a graceful shutdown. The only call to tx.send() seems to come after the server has already shutdown.

Am I misunderstanding something.

I looked at the commit where the code was introduced ( a1b9cf1 ) but that did nothing to resolve my confusion.

http-1.patch.txt

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions