Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 11d86a76 authored by Mike Yu's avatar Mike Yu Committed by Automerger Merge Worker
Browse files

DoH: Change to use runtime with current thread scheduler in doh_query() am:...

DoH: Change to use runtime with current thread scheduler in doh_query() am: 42a73532 am: 6b8f8092 am: 79b1db01

Original change: https://android-review.googlesource.com/c/platform/packages/modules/DnsResolver/+/1936192

Change-Id: I86ad6ac1b5c0d70f1bc4314b518772acf8e57602
parents 06d8721d 79b1db01
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -29,7 +29,7 @@ use std::os::unix::io::RawFd;
use std::str::FromStr;
use std::sync::{Arc, Mutex};
use std::{ptr, slice};
use tokio::runtime::Runtime;
use tokio::runtime::Builder;
use tokio::sync::oneshot;
use tokio::task;
use url::Url;
@@ -275,7 +275,7 @@ pub unsafe extern "C" fn doh_query(
        return DOH_RESULT_CAN_NOT_SEND;
    }

    if let Ok(rt) = Runtime::new() {
    if let Ok(rt) = Builder::new_current_thread().enable_all().build() {
        let local = task::LocalSet::new();
        match local.block_on(&rt, async { timeout(t, resp_rx).await }) {
            Ok(v) => match v {