reqwest icon indicating copy to clipboard operation
reqwest copied to clipboard

http3 make request future sync

Open Ruben2424 opened this issue 1 year ago • 2 comments

Should fix #2322 .

Requires new h3-quinn release and https://github.com/hyperium/h3/pull/249 to be merged.

I removed the http3 specific Resolver trait. Was there a reason for a second one?

I am not familiar with this code base, so please make sure the additional Sync bounds do not break something.

Ruben2424 avatar Jun 29 '24 12:06 Ruben2424

CI is currently failing. At the moment it does not compile with hickory-dns feature enabled. I check with the master branch and with the hickory-dns the response future is also not Sync

Should this also work with hickory-dns? or just with http3? I took a quick look at hickory-dns. As far as I understood the crate it is probably not trivial to make their types Sync.

Ruben2424 avatar Jul 01 '24 22:07 Ruben2424

I cannot say when I will continue on this PR. If someone wants to continue, feel free to do so.

Ruben2424 avatar Jul 13 '24 20:07 Ruben2424

@Ruben2424 were you planning to continue the PR anytime soon? I think wrapping the async block with sync_wrapper would work in this case:

// src/dns/hickory.rs
Box::pin(sync_wrapper::SyncFuture::new(async move {
    let resolver = resolver.state.get_or_try_init(new_resolver)?;

    let lookup = resolver.lookup_ip(name.as_str()).await?;
    let addrs: Addrs = Box::new(SocketAddrs {
        iter: lookup.into_iter(),
    });
    Ok(addrs)
}))

ducaale avatar Jan 04 '25 18:01 ducaale

@Ruben2424 were you planning to continue the PR anytime soon?

No

Ruben2424 avatar Jan 05 '25 15:01 Ruben2424

This was done in #2685.

seanmonstar avatar May 27 '25 16:05 seanmonstar