diff --git a/src/backend.rs b/src/backend.rs index 5235f8e..4892495 100644 --- a/src/backend.rs +++ b/src/backend.rs @@ -111,7 +111,7 @@ impl BackendInfo { pub async fn connect(&self) -> Result { // If addr is a relative or absolute path, consider it's a socket if self.addr.starts_with('.') || self.addr.starts_with('/') { - match timeout(Duration::from_secs(1), UnixStream::connect(&self.addr)).await { + match timeout(Duration::from_secs(5), UnixStream::connect(&self.addr)).await { Ok(Ok(stream)) => { trace!("connection established to {self}"); Ok(stream.into()) @@ -126,7 +126,7 @@ impl BackendInfo { } } } else { - match timeout(Duration::from_secs(1), TcpStream::connect(&self.addr)).await { + match timeout(Duration::from_secs(5), TcpStream::connect(&self.addr)).await { Ok(Ok(stream)) => { trace!("connection established to {self}"); Ok(stream.into()) diff --git a/src/main.rs b/src/main.rs index d544f03..76f1a4b 100644 --- a/src/main.rs +++ b/src/main.rs @@ -16,7 +16,7 @@ mod prelude; use prelude::*; mod stream; -const LDAP_CLIENT_IO_TIMEOUT: Duration = Duration::from_secs(1); +const LDAP_CLIENT_IO_TIMEOUT: Duration = Duration::from_secs(5); #[derive(Debug, Clone)] pub enum LdapError {