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

Commit d459bdf2 authored by Android Build Coastguard Worker's avatar Android Build Coastguard Worker
Browse files

Snap for 7978492 from 580ec834 to tm-d1-release

Change-Id: Ia895d0d15b150d104ed54ef5f7cd8e1e9a3b8dc7
parents 7121f0d7 580ec834
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -283,6 +283,7 @@ impl H3Driver {
        // If the request has already timed out, don't issue it to the server.
        if let Some(expiry) = request.expiry {
            if BootTime::now() > expiry {
                warn!("Abandoning expired DNS request");
                return Ok(());
            }
        }
+9 −2
Original line number Diff line number Diff line
@@ -21,7 +21,7 @@ use crate::config::Config;
use crate::connection::Connection;
use crate::dispatcher::{QueryError, Response};
use crate::encoding;
use anyhow::{anyhow, Result};
use anyhow::{anyhow, bail, Result};
use std::sync::Arc;
use tokio::sync::{mpsc, watch};
use tokio::task;
@@ -90,7 +90,7 @@ async fn build_connection(
}

impl Driver {
    const MAX_BUFFERED_COMMANDS: usize = 10;
    const MAX_BUFFERED_COMMANDS: usize = 50;

    pub async fn new(
        info: ServerInfo,
@@ -175,6 +175,13 @@ impl Driver {
    }

    async fn send_query(&mut self, query: Query) -> Result<()> {
        // If the associated receiver has been closed, meaning that the request has already
        // timed out, just drop it. This check helps drain the channel quickly in the case
        // where the network is stalled.
        if query.response.is_closed() {
            bail!("Abandoning expired DNS request")
        }

        if !self.connection.wait_for_live().await {
            // Try reconnecting
            self.connection =
+1 −1
Original line number Diff line number Diff line
@@ -102,7 +102,7 @@ impl Network {
                .unwrap_or_else(|_| {
                    warn!("Query result listener went away before receiving a response")
                }),
            Status::Live => self.command_tx.send(Command::Query(query)).await?,
            Status::Live => self.command_tx.try_send(Command::Query(query))?,
        }
        Ok(())
    }
+2 −0
Original line number Diff line number Diff line
@@ -31,6 +31,8 @@ struct Stats {
    uint32_t queries_received;
    /// The number of accumulated QUIC connections accepted.
    uint32_t connections_accepted;
    /// The number of QUIC connections alive.
    uint32_t alive_connections;
};

extern "C" {
+8 −0
Original line number Diff line number Diff line
@@ -222,6 +222,10 @@ impl Client {
    pub fn on_timeout(&mut self) {
        self.conn.on_timeout();
    }

    pub fn is_alive(&self) -> bool {
        self.conn.is_established() && !self.conn.is_closed()
    }
}

impl std::fmt::Debug for Client {
@@ -286,6 +290,10 @@ impl ClientMap {
        self.clients.iter_mut()
    }

    pub fn iter(&mut self) -> hash_map::Iter<ConnectionID, Client> {
        self.clients.iter()
    }

    pub fn len(&mut self) -> usize {
        self.clients.len()
    }
Loading